Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: mcp-core: Make mcp_bus_type const

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.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-mfd-v1-1-07335ebc034f@marliere.net
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Ricardo B. Marliere and committed by
Lee Jones
6abc896c c28c4560

+1 -1
+1 -1
drivers/mfd/mcp-core.c
··· 41 41 drv->remove(mcp); 42 42 } 43 43 44 - static struct bus_type mcp_bus_type = { 44 + static const struct bus_type mcp_bus_type = { 45 45 .name = "mcp", 46 46 .match = mcp_bus_match, 47 47 .probe = mcp_bus_probe,