Skip to contentSkip to conversation

mfd: core: constify the struct device_type usage

PATCH Applied Ricardo B. Marliere 2 participants 2 messages Feb 19, 2024 – Feb 23, 2024 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mfd-core.c +1 -1
index 2b85509a90fc..6ad5c93027af 100644
@@ -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",
 };
 

---
base-commit: d5132d176d6f21742ac67fd311ccc61fe830e999
change-id: 20240219-device_cleanup-mfd-885cbab2befe

Best regards,

Signature · 1 line
Ricardo B. Marliere <[email protected]>
maintainer Applied
#1 lore raw

Re: (subset) [PATCH] mfd: core: constify the struct device_type usage

Quoted 6 lines · Ricardo B. Marliere

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.

Applied, thanks!

[1/1] mfd: core: constify the struct device_type usage

      commit: 3cb10854004d2cb9c8f3a33deeeb499d0e0c7120

--
Lee Jones [李琼斯]