[PATCH] mfd: mcp-core: make mcp_bus_type const

From: Ricardo B. Marliere
Date: Sun Feb 04 2024 - 15:10:13 EST


Now that the driver core can properly handle constant struct bus_type,
move the mcp_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@xxxxxxxxxxxxxxxxxxx>
Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>
---
drivers/mfd/mcp-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/mcp-core.c b/drivers/mfd/mcp-core.c
index 2fa592c37c6f..16ca23311cab 100644
--- a/drivers/mfd/mcp-core.c
+++ b/drivers/mfd/mcp-core.c
@@ -41,7 +41,7 @@ static void mcp_bus_remove(struct device *dev)
drv->remove(mcp);
}

-static struct bus_type mcp_bus_type = {
+static const struct bus_type mcp_bus_type = {
.name = "mcp",
.match = mcp_bus_match,
.probe = mcp_bus_probe,

---
base-commit: 1e0ea9e75ff3f395ad6f85f0be2258ef114a53dc
change-id: 20240204-bus_cleanup-mfd-6ffb8bdbe13c

Best regards,
--
Ricardo B. Marliere <ricardo@xxxxxxxxxxxx>