]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bus: mhi: host: make mhi_bus_type const
authorKunwu Chan <chentao@kylinos.cn>
Fri, 23 Aug 2024 03:11:28 +0000 (11:11 +0800)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Mon, 26 Aug 2024 08:28:27 +0000 (13:58 +0530)
Now that the driver core can properly handle constant struct bus_type,
move the mhi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20240823031129.49010-1-kunwu.chan@linux.dev
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/host/init.c
drivers/bus/mhi/host/internal.h

index ce7d2e62c2f18e2f7033cd190e8637509339d5b3..a9b1f8beee7bc9788328e04f9cf37c995acf35ce 100644 (file)
@@ -1464,7 +1464,7 @@ static int mhi_match(struct device *dev, const struct device_driver *drv)
        return 0;
 };
 
-struct bus_type mhi_bus_type = {
+const struct bus_type mhi_bus_type = {
        .name = "mhi",
        .dev_name = "mhi",
        .match = mhi_match,
index aaad40a07f6925a3f70872a77176c5f6fd766052..d057e877932e3a0e7eab5ef08545257bf09e6a27 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "../common.h"
 
-extern struct bus_type mhi_bus_type;
+extern const struct bus_type mhi_bus_type;
 
 /* Host request register */
 #define MHI_SOC_RESET_REQ_OFFSET                       0xb0