staging: greybus: gbphy: make gbphy_bus_type const
Greg Kroah-Hartman
maintainerPATCH 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.
Cc Johan Hovold <[email protected]>
Cc Alex Elder <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- drivers/staging/greybus/gbphy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/greybus/gbphy.c +1 -1
@@ -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
Quoted 9 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move thegbphy_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.Cc Johan Hovold <[email protected]>Cc Alex Elder <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Reviewed-by Johan Hovold <[email protected]>