fsi: make fsi_bus_type constant
PATCH v2 1/1 fsi: make fsi_bus_type constant
Now that the driver core can properly handle constant struct bus_type, move the fsi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Cc Eddie James <[email protected]>
Cc Ninad Palsule <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
---
v2: fix up subject line to be correct
drivers/fsi/fsi-core.c | 2 +- include/linux/fsi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/fsi/fsi-core.c +1 -1
@@ -1404,7 +1404,7 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv) }EXPORT_SYMBOL_GPL (fsi_driver_unregister); -struct bus_type fsi_bus_type = { +const struct bus_type fsi_bus_type = { .name ="fsi" , .match = fsi_bus_match, };
include/linux/fsi.h +1 -1
@@ -68,7 +68,7 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,extern int fsi_slave_write (struct fsi_slave *slave,uint32_t addr,const void *val,size_t size); -extern struct bus_type fsi_bus_type; +extern const struct bus_type fsi_bus_type;extern const struct device_type fsi_cdev_type;enum fsi_dev_type {
Signature · 1 line
2.50.0
Quoted 3 lines · Greg Kroah-Hartman
Now that the driver core can properly handle constant struct
bus_type, move thefsi_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Reviewed-by Eddie James <[email protected]>
Thanks Greg.
Quoted 38 lines
Cc Eddie James <[email protected]>Cc Ninad Palsule <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>---
v2: fix up subject line to be correctdrivers/fsi/fsi-core.c | 2 +- include/linux/fsi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/fsi/fsi-core.c +1
-1@@ -1404,7 +1404,7 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv) }EXPORT_SYMBOL_GPL (fsi_driver_unregister); -struct bus_type fsi_bus_type = { +const struct bus_type fsi_bus_type = { .name ="fsi" , .match = fsi_bus_match, };include/linux/fsi.h +1
-1@@ -68,7 +68,7 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,extern int fsi_slave_write (struct fsi_slave *slave,uint32_t addr,const void *val,size_t size); -extern struct bus_type fsi_bus_type; +extern const struct bus_type fsi_bus_type;extern const struct device_type fsi_cdev_type;enum fsi_dev_type {