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

nubus: Make nubus_bus_type static and constant

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

It's also never used outside of drivers/nubus/bus.c so make it static
and don't export it as no one is using it.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Finn Thain <fthain@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/2023121940-enlarged-editor-c9a8@gregkh
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Greg Kroah-Hartman and committed by
Geert Uytterhoeven
a15f2d48 b85ea95d

+1 -4
+1 -2
drivers/nubus/bus.c
··· 32 32 ndrv->remove(to_nubus_board(dev)); 33 33 } 34 34 35 - struct bus_type nubus_bus_type = { 35 + static const struct bus_type nubus_bus_type = { 36 36 .name = "nubus", 37 37 .probe = nubus_device_probe, 38 38 .remove = nubus_device_remove, 39 39 }; 40 - EXPORT_SYMBOL(nubus_bus_type); 41 40 42 41 int nubus_driver_register(struct nubus_driver *ndrv) 43 42 {
-2
include/linux/nubus.h
··· 89 89 void (*remove)(struct nubus_board *board); 90 90 }; 91 91 92 - extern struct bus_type nubus_bus_type; 93 - 94 92 /* Generic NuBus interface functions, modelled after the PCI interface */ 95 93 #ifdef CONFIG_PROC_FS 96 94 extern bool nubus_populate_procfs;