staging: fieldbus: make anybus_bus const
authorRicardo B. Marliere <ricardo@marliere.net>
Sat, 3 Feb 2024 18:11:35 +0000 (15:11 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2024 16:30:30 +0000 (17:30 +0100)
Now that the driver core can properly handle constant struct bus_type,
move the anybus_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240203-bus_cleanup-staging-v1-1-a13448ddb4c7@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fieldbus/anybuss/host.c

index cd86b9c9e3458d9daf23032d17be7aa87108ff68..410e6f8073c0bbdba4bd91a81b949b07dae1072b 100644 (file)
@@ -1195,7 +1195,7 @@ static void anybus_bus_remove(struct device *dev)
                adrv->remove(to_anybuss_client(dev));
 }
 
-static struct bus_type anybus_bus = {
+static const struct bus_type anybus_bus = {
        .name           = "anybuss",
        .match          = anybus_bus_match,
        .probe          = anybus_bus_probe,