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

zorro: Make zorro_bus_type const

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the zorro_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>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240213-bus_cleanup-zorro-v1-1-388ceed8e7bd@marliere.net
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Ricardo B. Marliere and committed by
Geert Uytterhoeven
85a19e2b 6613476e

+2 -2
+1 -1
drivers/zorro/zorro-driver.c
··· 150 150 return 0; 151 151 } 152 152 153 - struct bus_type zorro_bus_type = { 153 + const struct bus_type zorro_bus_type = { 154 154 .name = "zorro", 155 155 .dev_name = "zorro", 156 156 .dev_groups = zorro_device_attribute_groups,
+1 -1
drivers/zorro/zorro.h
··· 4 4 * Zorro bus 5 5 */ 6 6 7 - extern struct bus_type zorro_bus_type; 7 + extern const struct bus_type zorro_bus_type; 8 8 9 9 10 10 #ifdef CONFIG_ZORRO_NAMES