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

Configure Feed

Select the types of activity you want to include in your feed.

staging: vc04_services: vchiq_arm: make vchiq_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the vchiq_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240208-bus_cleanup-staging2-v1-1-cfe906133a2c@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricardo B. Marliere and committed by
Greg Kroah-Hartman
869eb452 e1f97d7e

+2 -2
+1 -1
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.c
··· 37 37 return driver->probe(device); 38 38 } 39 39 40 - struct bus_type vchiq_bus_type = { 40 + const struct bus_type vchiq_bus_type = { 41 41 .name = "vchiq-bus", 42 42 .match = vchiq_bus_type_match, 43 43 .uevent = vchiq_bus_uevent,
+1 -1
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_bus.h
··· 34 34 return container_of(d, struct vchiq_driver, driver); 35 35 } 36 36 37 - extern struct bus_type vchiq_bus_type; 37 + extern const struct bus_type vchiq_bus_type; 38 38 39 39 struct vchiq_device * 40 40 vchiq_device_register(struct device *parent, const char *name);