Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: fixup for "driver core: make struct bus_type.uevent() take a const *"

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

arch/powerpc/platforms/ps3/system-bus.c:472:19: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
472 | .uevent = ps3_system_bus_uevent,
| ^~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/ps3/system-bus.c:472:19: note: (near initialization for 'ps3_system_bus_type.uevent')
arch/powerpc/platforms/pseries/ibmebus.c:436:22: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
436 | .uevent = ibmebus_bus_modalias,
| ^~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/pseries/ibmebus.c:436:22: note: (near initialization for 'ibmebus_bus_type.uevent')

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 2a81ada32f0e ("driver core: make struct bus_type.uevent() take a const *")
Link: https://lore.kernel.org/r/20230130152818.03c00ea3@canb.auug.org.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Stephen Rothwell and committed by
Greg Kroah-Hartman
b7810ea8 56d5f362

+3 -3
+1 -1
arch/powerpc/include/asm/ps3.h
··· 396 396 return container_of(_drv, struct ps3_system_bus_driver, core); 397 397 } 398 398 static inline struct ps3_system_bus_device *ps3_dev_to_system_bus_dev( 399 - struct device *_dev) 399 + const struct device *_dev) 400 400 { 401 401 return container_of(_dev, struct ps3_system_bus_device, core); 402 402 }
+1 -1
arch/powerpc/platforms/ps3/system-bus.c
··· 439 439 dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__); 440 440 } 441 441 442 - static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env) 442 + static int ps3_system_bus_uevent(const struct device *_dev, struct kobj_uevent_env *env) 443 443 { 444 444 struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); 445 445
+1 -1
arch/powerpc/platforms/pseries/ibmebus.c
··· 426 426 }; 427 427 ATTRIBUTE_GROUPS(ibmebus_bus_device); 428 428 429 - static int ibmebus_bus_modalias(struct device *dev, struct kobj_uevent_env *env) 429 + static int ibmebus_bus_modalias(const struct device *dev, struct kobj_uevent_env *env) 430 430 { 431 431 return of_device_uevent_modalias(dev, env); 432 432 }