]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bus: mhi: ep: Make mhi_ep_bus_type const
authorAdrian Barnaś <abarnas@google.com>
Fri, 19 Sep 2025 07:44:08 +0000 (07:44 +0000)
committerManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Wed, 15 Oct 2025 11:26:03 +0000 (16:56 +0530)
Because driver core can properly handle constant struct bus_type, move the
mhi_ep_bus_type to be a constant structure as well, placing it into
read-only memory which can not be modified at runtime.

Signed-off-by: Adrian Barnaś <abarnas@google.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/20250919074408.868220-1-abarnas@google.com
drivers/bus/mhi/ep/internal.h
drivers/bus/mhi/ep/main.c

index 577965f95fda9e27e9c21adb98df441ac1ad26a7..512da7482acc19de587205add01a09cdc321260a 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "../common.h"
 
-extern struct bus_type mhi_ep_bus_type;
+extern const struct bus_type mhi_ep_bus_type;
 
 #define MHI_REG_OFFSET                         0x100
 #define BHI_REG_OFFSET                         0x200
index cdea24e9291959ae0a92487c1b9698dc8164d2f1..86e003bc44e0b01cd7ee749f1df84f325f10ed88 100644 (file)
@@ -1703,7 +1703,7 @@ static int mhi_ep_match(struct device *dev, const struct device_driver *drv)
        return 0;
 };
 
-struct bus_type mhi_ep_bus_type = {
+const struct bus_type mhi_ep_bus_type = {
        .name = "mhi_ep",
        .dev_name = "mhi_ep",
        .match = mhi_ep_match,