[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <af81751a-f562-a7d5-b754-ff6ac02082c2@linux-m68k.org>
Date: Thu, 21 Dec 2023 09:18:10 +1100 (AEDT)
From: Finn Thain <fthain@...ux-m68k.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
cc: linux-kernel@...r.kernel.org, linux-m68k@...ts.linux-m68k.org
Subject: Re: [PATCH] nubus: make nubus_bus_type static and constant
On Tue, 19 Dec 2023, Greg Kroah-Hartman wrote:
> 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.
>
> Cc: Finn Thain <fthain@...ux-m68k.org>
> Cc: linux-m68k@...ts.linux-m68k.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Acked-by: Finn Thain <fthain@...ux-m68k.org>
Thanks, Greg.
> ---
> drivers/nubus/bus.c | 3 +--
> include/linux/nubus.h | 2 --
> 2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c
> index 72921e4f35f6..12df4d88970c 100644
> --- a/drivers/nubus/bus.c
> +++ b/drivers/nubus/bus.c
> @@ -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)
> {
> diff --git a/include/linux/nubus.h b/include/linux/nubus.h
> index bdcd85e622d8..4d103ac8f5c7 100644
> --- a/include/linux/nubus.h
> +++ b/include/linux/nubus.h
> @@ -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;
>
Powered by blists - more mailing lists