nubus: Make nubus_bus_type static and constant
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Dec 2023 15:47:41 +0000 (16:47 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Wed, 3 Jan 2024 12:33:59 +0000 (13:33 +0100)
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>
drivers/nubus/bus.c
include/linux/nubus.h

index 72921e4f35f6e6b5414fd98b64ef851879464356..12df4d88970c8088dbc05c6dc9f18da33c1e3f25 100644 (file)
@@ -32,12 +32,11 @@ static void nubus_device_remove(struct device *dev)
                ndrv->remove(to_nubus_board(dev));
 }
 
-struct bus_type nubus_bus_type = {
+static const struct bus_type nubus_bus_type = {
        .name           = "nubus",
        .probe          = nubus_device_probe,
        .remove         = nubus_device_remove,
 };
-EXPORT_SYMBOL(nubus_bus_type);
 
 int nubus_driver_register(struct nubus_driver *ndrv)
 {
index bdcd85e622d80f0d1fd7842ad892f08a525dd524..4d103ac8f5c7a90d609825de3f7fc348bf5fd5c9 100644 (file)
@@ -89,8 +89,6 @@ struct nubus_driver {
        void (*remove)(struct nubus_board *board);
 };
 
-extern struct bus_type nubus_bus_type;
-
 /* Generic NuBus interface functions, modelled after the PCI interface */
 #ifdef CONFIG_PROC_FS
 extern bool nubus_populate_procfs;