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 <dave@stgolabs.net> Cc: Jonathan Cameron <jonathan.cameron@huawei.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Alison Schofield <alison.schofield@intel.com> Cc: Vishal Verma <vishal.l.verma@intel.com> Cc: Ira Weiny <ira.weiny@intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: linux-cxl@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://patch.msgid.link/2025070138-vigorous-negative-eae7@gregkh Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent d7b9056 commit ac0fe6a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

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)