2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-11-27 03:55:37 +08:00

driver core: mark remaining local bus_type variables as const

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>
This commit is contained in:
Greg Kroah-Hartman 2023-12-19 16:35:09 +01:00
parent dedb868994
commit 580fc9c750
6 changed files with 6 additions and 6 deletions

View File

@ -244,7 +244,7 @@ static void auxiliary_bus_shutdown(struct device *dev)
auxdrv->shutdown(auxdev); auxdrv->shutdown(auxdev);
} }
static struct bus_type auxiliary_bus_type = { static const struct bus_type auxiliary_bus_type = {
.name = "auxiliary", .name = "auxiliary",
.probe = auxiliary_bus_probe, .probe = auxiliary_bus_probe,
.remove = auxiliary_bus_remove, .remove = auxiliary_bus_remove,

View File

@ -82,7 +82,7 @@ static int isa_bus_resume(struct device *dev)
return 0; return 0;
} }
static struct bus_type isa_bus_type = { static const struct bus_type isa_bus_type = {
.name = "isa", .name = "isa",
.match = isa_bus_match, .match = isa_bus_match,
.probe = isa_bus_probe, .probe = isa_bus_probe,

View 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_online(struct device *dev);
static int memory_subsys_offline(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, .name = MEMORY_CLASS_NAME,
.dev_name = MEMORY_CLASS_NAME, .dev_name = MEMORY_CLASS_NAME,
.online = memory_subsys_online, .online = memory_subsys_online,

View File

@ -21,7 +21,7 @@
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/slab.h> #include <linux/slab.h>
static struct bus_type node_subsys = { static const struct bus_type node_subsys = {
.name = "node", .name = "node",
.dev_name = "node", .dev_name = "node",
}; };

View File

@ -2670,7 +2670,7 @@ static void genpd_release_dev(struct device *dev)
kfree(dev); kfree(dev);
} }
static struct bus_type genpd_bus_type = { static const struct bus_type genpd_bus_type = {
.name = "genpd", .name = "genpd",
}; };

View File

@ -28,7 +28,7 @@ struct soc_device {
int soc_dev_num; int soc_dev_num;
}; };
static struct bus_type soc_bus_type = { static const struct bus_type soc_bus_type = {
.name = "soc", .name = "soc",
}; };
static bool soc_bus_registered; static bool soc_bus_registered;