Skip to content

Commit 8e54ace

Browse files
KunWuChanMani-Sadhasivam
authored andcommitted
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 <[email protected]> Signed-off-by: Kunwu Chan <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent bfc5ca0 commit 8e54ace

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/bus/mhi/host/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ static int mhi_match(struct device *dev, const struct device_driver *drv)
14641464
return 0;
14651465
};
14661466

1467-
struct bus_type mhi_bus_type = {
1467+
const struct bus_type mhi_bus_type = {
14681468
.name = "mhi",
14691469
.dev_name = "mhi",
14701470
.match = mhi_match,

drivers/bus/mhi/host/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "../common.h"
1111

12-
extern struct bus_type mhi_bus_type;
12+
extern const struct bus_type mhi_bus_type;
1313

1414
/* Host request register */
1515
#define MHI_SOC_RESET_REQ_OFFSET 0xb0

0 commit comments

Comments
 (0)