cxl: make cdx_bus_type constant
PATCH 1/1 cxl: make cdx_bus_type constant
Now that the driver core can properly handle constant struct bus_type, move the cxl_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Cc Davidlohr Bueso <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Dave Jiang <[email protected]>
Cc Alison Schofield <[email protected]>
Cc Vishal Verma <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Dan Williams <[email protected]>
Signed-off-by Greg Kroah-Hartman <[email protected]>
--- drivers/cxl/core/port.c | 2 +- drivers/cxl/cxl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/cxl/core/port.c +1 -1
@@ -2293,7 +2293,7 @@ static const struct attribute_group *cxl_bus_attribute_groups[] = { NULL, }; -struct bus_type cxl_bus_type = { +const struct bus_type cxl_bus_type = { .name ="cxl" , .uevent = cxl_bus_uevent, .match = cxl_bus_match,
drivers/cxl/cxl.h +1 -1
@@ -815,7 +815,7 @@ int cxl_dvsec_rr_decode(struct cxl_dev_state *cxlds,bool is_cxl_region (struct device *dev); -extern struct bus_type cxl_bus_type; +extern const struct bus_type cxl_bus_type;struct cxl_driver {const char *name;
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 thecxl_bus_typevariable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Ugh, got the subject wrong, let me go fix up...