]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cxl: make cxl_bus_type constant
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2025 12:07:39 +0000 (14:07 +0200)
committerDave Jiang <dave.jiang@intel.com>
Tue, 1 Jul 2025 15:12:57 +0000 (08:12 -0700)
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>
drivers/cxl/core/port.c
drivers/cxl/cxl.h

index eb46c6764d20225f5bc7210975ec0aee80a8a4a1..0696f7fcef568f63ff134629641568085037442f 100644 (file)
@@ -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,
index 3f1695c96abca99bb3484304e813cce3b74e4f13..e7b66ca1d4230d684e902319975fc14bfd149294 100644 (file)
@@ -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;