Skip to content

Commit ac0fe6a

Browse files
gregkhdavejiang
authored andcommitted
cxl: make cxl_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]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://patch.msgid.link/2025070138-vigorous-negative-eae7@gregkh Signed-off-by: Dave Jiang <[email protected]>
1 parent d7b9056 commit ac0fe6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/cxl/core/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ static const struct attribute_group *cxl_bus_attribute_groups[] = {
22932293
NULL,
22942294
};
22952295

2296-
struct bus_type cxl_bus_type = {
2296+
const struct bus_type cxl_bus_type = {
22972297
.name = "cxl",
22982298
.uevent = cxl_bus_uevent,
22992299
.match = cxl_bus_match,

drivers/cxl/cxl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ int cxl_dvsec_rr_decode(struct cxl_dev_state *cxlds,
815815

816816
bool is_cxl_region(struct device *dev);
817817

818-
extern struct bus_type cxl_bus_type;
818+
extern const struct bus_type cxl_bus_type;
819819

820820
struct cxl_driver {
821821
const char *name;

0 commit comments

Comments
 (0)