nvmem: zynqmp_nvmem: unbreak driver after cleanup
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.
---
Changes since v1:
- Cc stable
drivers/nvmem/zynqmp_nvmem.c | 1 + 1 file changed, 1 insertion(+)
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;
Signature · 1 line
2.39.5
Quoted 21 lines · Peter Korsgaard
Commit
29be47fcd6a0("nvmem:zynqmp_nvmem:zynqmp_nvmem_probecleanup") 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")Signed-off-by Peter Korsgaard <[email protected]>---
Changes since v1:
- Cc stabledrivers/nvmem/zynqmp_nvmem.c | 1 + 1 file changed, 1 insertion(+)drivers/nvmem/zynqmp_nvmem.c +0
-0
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
Quoted 8 lines · Peter Korsgaard
Commit
29be47fcd6a0("nvmem:zynqmp_nvmem:zynqmp_nvmem_probecleanup") 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]>