Skip to contentSkip to conversation

nvmem: make nvmem_bus_type constant

PATCH Applied Greg Kroah-Hartman 2 participants 2 messages Jul 1, 2025 – Jul 11, 2025 NVMEM framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvmem: make nvmem_bus_type constant

Now that the driver core can properly handle constant struct bus_type, move the nvmem_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.

Cc Srinivas Kandagatla <[email protected]>
---
 drivers/nvmem/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/core.c +1 -1
index fd2a9698d1c9..e74bfb956dac 100644
@@ -544,7 +544,7 @@ static const struct device_type nvmem_provider_type = {
 	.release	= nvmem_release,
 };
 
-static struct bus_type nvmem_bus_type = {
+static const struct bus_type nvmem_bus_type = {
 	.name		= "nvmem",
 };
 
Signature · 1 line
2.50.0
maintainer Applied
#1 lore raw
Quoted 5 lines · Greg Kroah-Hartman

Now that the driver core can properly handle constant struct bus_type, move the nvmem_bus_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] nvmem: make nvmem_bus_type constant

      commit: 40ae493d572497956b275f755dc80ee3b87a1559

Best regards,

Signature · 1 line
Srinivas Kandagatla <[email protected]>