Skip to contentSkip to conversation

nvmem: zynqmp_nvmem: unbreak driver after cleanup

PATCH Applied Peter Korsgaard 3 participants 3 messages Apr 22, 2025 – Apr 29, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nvmem: zynqmp_nvmem: unbreak driver after cleanup

Commit 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup") changed the driver to expect the device pointer to be passed as the "context", but in nvmem the context parameter comes from nvmem_config.priv which is never set - Leading to null pointer exceptions when the device is accessed.

Fixes 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup")

---
Changes since v1:
- Cc stable

 drivers/nvmem/zynqmp_nvmem.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvmem/zynqmp_nvmem.c +1 -0
index 8682adaacd692..7da717d6c7faf 100644
@@ -213,6 +213,7 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev)
 	econfig.word_size = 1;
 	econfig.size = ZYNQMP_NVMEM_SIZE;
 	econfig.dev = dev;
+	econfig.priv = dev;
 	econfig.add_legacy_fixed_of_cells = true;
 	econfig.reg_read = zynqmp_nvmem_read;
 	econfig.reg_write = zynqmp_nvmem_write;
Signature · 1 line
2.39.5
maintainer Reviewed-by Tested-by on v2 1/1
#1 lore raw
Quoted 21 lines · Peter Korsgaard

Commit 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup") changed the driver to expect the device pointer to be passed as the "context", but in nvmem the context parameter comes from nvmem_config.priv which is never set - Leading to null pointer exceptions when the device is accessed.

Fixes 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup")

---
Changes since v1:
- Cc stable

  drivers/nvmem/zynqmp_nvmem.c | 1 +
  1 file changed, 1 insertion(+)
drivers/nvmem/zynqmp_nvmem.c +0 -0
index 8682adaacd692..7da717d6c7faf 100644

drivers/nvmem/zynqmp_nvmem.c static int zynqmp_nvmem_probe(struct platform_device *pdev) · line 219

Quoted 7 lines
drivers/nvmem/zynqmp_nvmem.c +1 -0
@@ -213,6 +213,7 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev)
  	econfig.word_size = 1;
  	econfig.size = ZYNQMP_NVMEM_SIZE;
  	econfig.dev = dev;
+	econfig.priv = dev;
  	econfig.add_legacy_fixed_of_cells = true;
  	econfig.reg_read = zynqmp_nvmem_read;
  	econfig.reg_write = zynqmp_nvmem_write;

Thanks,
Michal

maintainer Applied
#2 lore raw
In reply to Peter Korsgaard
Quoted 8 lines · Peter Korsgaard

Commit 29be47fcd6a0 ("nvmem: zynqmp_nvmem: zynqmp_nvmem_probe cleanup") changed the driver to expect the device pointer to be passed as the "context", but in nvmem the context parameter comes from nvmem_config.priv which is never set - Leading to null pointer exceptions when the device is accessed.

[...]

Applied, thanks!

[1/1] nvmem: zynqmp_nvmem: unbreak driver after cleanup

      commit: c708bbd57d158d9f20c2fcea5bcb6e0afac77bef

Best regards,

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