Skip to content

Commit

Permalink
nubus: Make nubus_bus_type static and constant
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Finn Thain <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/2023121940-enlarged-editor-c9a8@gregkh
Signed-off-by: Geert Uytterhoeven <[email protected]>
  • Loading branch information
gregkh authored and geertu committed Jan 3, 2024
1 parent b85ea95 commit a15f2d4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/nubus/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions include/linux/nubus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a15f2d4

Please sign in to comment.