staging: vme: make vme_bus_type const
authorRicardo B. Marliere <ricardo@marliere.net>
Thu, 8 Feb 2024 19:17:52 +0000 (16:17 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2024 16:30:33 +0000 (17:30 +0100)
Now that the driver core can properly handle constant struct bus_type,
move the vme_bus_type 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/20240208-bus_cleanup-staging2-v1-2-cfe906133a2c@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vme_user/vme.c
drivers/staging/vme_user/vme.h

index e9461a7a7ab8ba40ed8978134928a5d669f44f5c..0cd370ab1008813f076e6fdce5af928078b4992f 100644 (file)
@@ -1970,7 +1970,7 @@ static void vme_bus_remove(struct device *dev)
                driver->remove(vdev);
 }
 
-struct bus_type vme_bus_type = {
+const struct bus_type vme_bus_type = {
        .name = "vme",
        .match = vme_bus_match,
        .probe = vme_bus_probe,
index 06504dccd5ff0cef4fcdad990624b8251cd0e7cb..26aa40f78a74f70176027bbdb79eb99c895c856a 100644 (file)
@@ -81,7 +81,7 @@ struct vme_resource {
        struct list_head *entry;
 };
 
-extern struct bus_type vme_bus_type;
+extern const struct bus_type vme_bus_type;
 
 /* Number of VME interrupt vectors */
 #define VME_NUM_STATUSID       256