Commit 580fc9c7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
Acked-by: default avatarDave Ertman <david.m.ertman@intel.com>
Link: https://lore.kernel.org/r/2023121908-paver-follow-cc21@gregkh


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dedb8689
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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",
};
+1 −1
Original line number Diff line number Diff line
@@ -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",
};

Loading