From: Ricardo B. Marliere Date: Mon, 19 Feb 2024 19:51:10 +0000 (-0300) Subject: mfd: core: Constify the struct device_type usage X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3cb10854004d2cb9c8f3a33deeeb499d0e0c7120;p=linux.git mfd: core: Constify the struct device_type usage Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the mfd_dev_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 Signed-off-by: Ricardo B. Marliere Link: https://lore.kernel.org/r/20240219-device_cleanup-mfd-v1-1-e4eef5ed2da8@marliere.net Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 2b85509a90fc2..6ad5c93027afc 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -29,7 +29,7 @@ struct mfd_of_node_entry { struct device_node *np; }; -static struct device_type mfd_dev_type = { +static const struct device_type mfd_dev_type = { .name = "mfd_device", };