Skip to contentSkip to conversation

staging: greybus: gbphy: make gbphy_bus_type const

PATCH In review Greg Kroah-Hartman 2 participants 2 messages Jan 5, 2024

Subsystems (2)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 staging: greybus: gbphy: make gbphy_bus_type const

Now that the driver core can properly handle constant struct bus_type, move the gbphy_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.

---
 drivers/staging/greybus/gbphy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/gbphy.c +1 -1
index 6a7d8cf2a1eb..1c41b008ba39 100644
@@ -182,7 +182,7 @@ static void gbphy_dev_remove(struct device *dev)
 	pm_runtime_dont_use_autosuspend(dev);
 }
 
-static struct bus_type gbphy_bus_type = {
+static const struct bus_type gbphy_bus_type = {
 	.name =		"gbphy",
 	.match =	gbphy_dev_match,
 	.probe =	gbphy_dev_probe,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Greg Kroah-Hartman

Now that the driver core can properly handle constant struct bus_type, move the gbphy_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.