Skip to content

Commit 580fc9c

Browse files
committed
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 <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: Len Brown <[email protected]> Acked-by: William Breathitt Gray <[email protected]> Acked-by: Dave Ertman <[email protected]> Link: https://lore.kernel.org/r/2023121908-paver-follow-cc21@gregkh Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dedb868 commit 580fc9c

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

drivers/base/auxiliary.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static void auxiliary_bus_shutdown(struct device *dev)
244244
auxdrv->shutdown(auxdev);
245245
}
246246

247-
static struct bus_type auxiliary_bus_type = {
247+
static const struct bus_type auxiliary_bus_type = {
248248
.name = "auxiliary",
249249
.probe = auxiliary_bus_probe,
250250
.remove = auxiliary_bus_remove,

drivers/base/isa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int isa_bus_resume(struct device *dev)
8282
return 0;
8383
}
8484

85-
static struct bus_type isa_bus_type = {
85+
static const struct bus_type isa_bus_type = {
8686
.name = "isa",
8787
.match = isa_bus_match,
8888
.probe = isa_bus_probe,

drivers/base/memory.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static inline unsigned long phys_to_block_id(unsigned long phys)
6868
static int memory_subsys_online(struct device *dev);
6969
static int memory_subsys_offline(struct device *dev);
7070

71-
static struct bus_type memory_subsys = {
71+
static const struct bus_type memory_subsys = {
7272
.name = MEMORY_CLASS_NAME,
7373
.dev_name = MEMORY_CLASS_NAME,
7474
.online = memory_subsys_online,

drivers/base/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <linux/swap.h>
2222
#include <linux/slab.h>
2323

24-
static struct bus_type node_subsys = {
24+
static const struct bus_type node_subsys = {
2525
.name = "node",
2626
.dev_name = "node",
2727
};

drivers/base/power/domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2670,7 +2670,7 @@ static void genpd_release_dev(struct device *dev)
26702670
kfree(dev);
26712671
}
26722672

2673-
static struct bus_type genpd_bus_type = {
2673+
static const struct bus_type genpd_bus_type = {
26742674
.name = "genpd",
26752675
};
26762676

drivers/base/soc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct soc_device {
2828
int soc_dev_num;
2929
};
3030

31-
static struct bus_type soc_bus_type = {
31+
static const struct bus_type soc_bus_type = {
3232
.name = "soc",
3333
};
3434
static bool soc_bus_registered;

0 commit comments

Comments
 (0)