diff mbox series

bus: mhi: ep: make mhi_ep_bus_type const

Message ID 20240208-bus_cleanup-mhi-v1-1-ee80f4e71845@marliere.net
State New
Headers show
Series bus: mhi: ep: make mhi_ep_bus_type const | expand

Commit Message

Ricardo B. Marliere Feb. 8, 2024, 7:12 p.m. UTC
Now that the driver core can properly handle constant struct bus_type,
move the mhi_ep_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 drivers/bus/mhi/ep/internal.h | 2 +-
 drivers/bus/mhi/ep/main.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


---
base-commit: ceeb64f41fe6a1eb9fc56d583983a81f8f3dd058
change-id: 20240208-bus_cleanup-mhi-cff3d8395b88

Best regards,

Comments

Ricardo B. Marliere Feb. 8, 2024, 7:23 p.m. UTC | #1
Sorry, please disregard this one. I'll send a series that includes it
instead.

Thanks,
-	Ricardo.
diff mbox series

Patch

diff --git a/drivers/bus/mhi/ep/internal.h b/drivers/bus/mhi/ep/internal.h
index 577965f95fda..512da7482acc 100644
--- a/drivers/bus/mhi/ep/internal.h
+++ b/drivers/bus/mhi/ep/internal.h
@@ -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
diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
index 8d7a4102bdb7..a583038131d3 100644
--- a/drivers/bus/mhi/ep/main.c
+++ b/drivers/bus/mhi/ep/main.c
@@ -1716,7 +1716,7 @@  static int mhi_ep_match(struct device *dev, 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,