driver core: mark remaining local bus_type variables as const
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Dec 2023 15:35:09 +0000 (16:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Dec 2023 12:56:30 +0000 (13:56 +0100)
Now that the driver core can properly handle constant struct bus_type,
change the local driver core bus_type variables to be a constant
structure as well, placing them into read-only memory which can not be
modified at runtime.

Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Rafael J. Wysocki <rafael@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Len Brown <len.brown@intel.com>
Acked-by: William Breathitt Gray <william.gray@linaro.org>
Acked-by: Dave Ertman <david.m.ertman@intel.com>
Link: https://lore.kernel.org/r/2023121908-paver-follow-cc21@gregkh
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/auxiliary.c
drivers/base/isa.c
drivers/base/memory.c
drivers/base/node.c
drivers/base/power/domain.c
drivers/base/soc.c

index 4d4c2c8d26c4808aa61c13ef2c3357e2bebf8564..d3a2c40c2f1272ca59ef75aa978e843dc5305ccf 100644 (file)
@@ -244,7 +244,7 @@ static void auxiliary_bus_shutdown(struct device *dev)
                auxdrv->shutdown(auxdev);
 }
 
-static struct bus_type auxiliary_bus_type = {
+static const struct bus_type auxiliary_bus_type = {
        .name = "auxiliary",
        .probe = auxiliary_bus_probe,
        .remove = auxiliary_bus_remove,
index 675ad3139224623bae18d17c7729b4e4b9c2d14e..e23d0b49a7934507850c5df37608559adee491a4 100644 (file)
@@ -82,7 +82,7 @@ static int isa_bus_resume(struct device *dev)
        return 0;
 }
 
-static struct bus_type isa_bus_type = {
+static const struct bus_type isa_bus_type = {
        .name           = "isa",
        .match          = isa_bus_match,
        .probe          = isa_bus_probe,
index f3b9a4d0fa3bb2a9c0c03614bae78f206b0c77b2..4ac3266da6b521a996fc2d3fdad0271ee3dbe8f6 100644 (file)
@@ -68,7 +68,7 @@ static inline unsigned long phys_to_block_id(unsigned long phys)
 static int memory_subsys_online(struct device *dev);
 static int memory_subsys_offline(struct device *dev);
 
-static struct bus_type memory_subsys = {
+static const struct bus_type memory_subsys = {
        .name = MEMORY_CLASS_NAME,
        .dev_name = MEMORY_CLASS_NAME,
        .online = memory_subsys_online,
index 4d588f4658c85cc1471da691fecbe744811812b4..433897eecbdcc9fcbbb80d5e5f35bd8683d26d03 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/swap.h>
 #include <linux/slab.h>
 
-static struct bus_type node_subsys = {
+static const struct bus_type node_subsys = {
        .name = "node",
        .dev_name = "node",
 };
index da1777e39eaa5298fbc41f3b7f9a313f3137f50f..096871334cc7f7885755b4b5e06fe238c44c6c56 100644 (file)
@@ -2670,7 +2670,7 @@ static void genpd_release_dev(struct device *dev)
        kfree(dev);
 }
 
-static struct bus_type genpd_bus_type = {
+static const struct bus_type genpd_bus_type = {
        .name           = "genpd",
 };
 
index c741d0845852af1b12ee7af8271e5bcccecb846d..282c38aece0de88049dc1e6e9bea00df52bed1ea 100644 (file)
@@ -28,7 +28,7 @@ struct soc_device {
        int soc_dev_num;
 };
 
-static struct bus_type soc_bus_type = {
+static const struct bus_type soc_bus_type = {
        .name  = "soc",
 };
 static bool soc_bus_registered;