Skip to content

Commit a15f2d4

Browse files
gregkhgeertu
authored andcommitted
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>
1 parent b85ea95 commit a15f2d4

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/nubus/bus.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ static void nubus_device_remove(struct device *dev)
3232
ndrv->remove(to_nubus_board(dev));
3333
}
3434

35-
struct bus_type nubus_bus_type = {
35+
static const struct bus_type nubus_bus_type = {
3636
.name = "nubus",
3737
.probe = nubus_device_probe,
3838
.remove = nubus_device_remove,
3939
};
40-
EXPORT_SYMBOL(nubus_bus_type);
4140

4241
int nubus_driver_register(struct nubus_driver *ndrv)
4342
{

include/linux/nubus.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ struct nubus_driver {
8989
void (*remove)(struct nubus_board *board);
9090
};
9191

92-
extern struct bus_type nubus_bus_type;
93-
9492
/* Generic NuBus interface functions, modelled after the PCI interface */
9593
#ifdef CONFIG_PROC_FS
9694
extern bool nubus_populate_procfs;

0 commit comments

Comments
 (0)