From: Kunwu Chan Date: Fri, 23 Aug 2024 03:11:28 +0000 (+0800) Subject: bus: mhi: host: make mhi_bus_type const X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8e54acedff45f40f5e11bf2d9ef7f48dd33b4ef9;p=users%2Fjedix%2Flinux-maple.git bus: mhi: host: make mhi_bus_type const 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 Signed-off-by: Kunwu Chan Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20240823031129.49010-1-kunwu.chan@linux.dev Signed-off-by: Manivannan Sadhasivam --- diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c index ce7d2e62c2f18..a9b1f8beee7bc 100644 --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c @@ -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, diff --git a/drivers/bus/mhi/host/internal.h b/drivers/bus/mhi/host/internal.h index aaad40a07f692..d057e877932e3 100644 --- a/drivers/bus/mhi/host/internal.h +++ b/drivers/bus/mhi/host/internal.h @@ -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