mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] nvmem: zynqmp_nvmem: unbreak driver after cleanup
@ 2025-04-22 14:21 Peter Korsgaard
  2025-04-29 10:04 ` Michal Simek
  2025-04-29 20:07 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Korsgaard @ 2025-04-22 14:21 UTC (permalink / raw)
  To: Praveen Teja Kundanala, Kalyani Akula, Michal Simek,
	Srinivas Kandagatla, Greg Kroah-Hartman
  Cc: Peter Korsgaard, stable, Kalyani Akula, linux-arm-kernel, linux-kernel

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")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
Changes since v1:
- Cc stable

 drivers/nvmem/zynqmp_nvmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c
index 8682adaacd692..7da717d6c7faf 100644
--- a/drivers/nvmem/zynqmp_nvmem.c
+++ b/drivers/nvmem/zynqmp_nvmem.c
@@ -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;
-- 
2.39.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-29 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-22 14:21 [PATCH v2] nvmem: zynqmp_nvmem: unbreak driver after cleanup Peter Korsgaard
2025-04-29 10:04 ` Michal Simek
2025-04-29 20:07 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®