Subject: linux-next: build failure after merge of the driver-core tree

From: Stephen Rothwell <[email-masked]>
Date: Thu, 1 Dec 2022 13:18:25 +1100

Hi all,

After merging the driver-core tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/gpu/drm/../../accel/drm_accel.c: In function 'accel_sysfs_init':
drivers/gpu/drm/../../accel/drm_accel.c:41:30: error: assignment to 'char * (*)(const struct device *, umode_t *)' {aka 'char * (*)(const struct device *, short unsigned int *)'} from incompatible pointer type 'char * (*)(struct device *, umode_t *)' {aka 'char * (*)(struct device *, short unsigned int *)'} [-Werror=incompatible-pointer-types]
   41 |         accel_class->devnode = accel_devnode;
      |                              ^

Caused by commit

  ff62b8e6588f ("driver core: make struct class.devnode() take a const *")

interacting with commit

  8bf4889762a8 ("drivers/accel: define kconfig and register a new major")

from the drm tree.

I have applied the following merge resolution patch.

From: Stephen Rothwell <[email-masked]>
Date: Thu, 1 Dec 2022 13:08:06 +1100
Subject: [PATCH] fix up for "drivers/accel: define kconfig and register a new major"

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 drivers/accel/drm_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/accel/drm_accel.c b/drivers/accel/drm_accel.c
index a5ee84a4017a..1b69824286fd 100644
--- a/drivers/accel/drm_accel.c
+++ b/drivers/accel/drm_accel.c
@@ -27,7 +27,7 @@ static struct device_type accel_sysfs_device_minor = {
 	.name = "accel_minor"
 };
 
-static char *accel_devnode(struct device *dev, umode_t *mode)
+static char *accel_devnode(const struct device *dev, umode_t *mode)
 {
 	return kasprintf(GFP_KERNEL, "accel/%s", dev_name(dev));
 }
-- 
2.35.1

-- 
Cheers,
Stephen Rothwell