All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] mtd: rawnand: brcmnand: propagate init error -EPROBE_DEFER up
@ 2023-07-19  8:43 Rafał Miłecki
  2023-07-20 18:52 ` Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rafał Miłecki @ 2023-07-19  8:43 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: Brian Norris, Kamal Dasu, linux-mtd, bcm-kernel-feedback-list,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

MTD subsystem may return -EPROBE_DEFER if something isn't ready yet.
It's important to pass that error up so device will get probed later.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
V2: Add of_node_put() - thanks Miquel!
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 39661e23d7d4..03764b589ec5 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -3245,6 +3245,10 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 
 			ret = brcmnand_init_cs(host, NULL);
 			if (ret) {
+				if (ret == -EPROBE_DEFER) {
+					of_node_put(child);
+					goto err;
+				}
 				devm_kfree(dev, host);
 				continue; /* Try all chip-selects */
 			}
-- 
2.35.3


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2023-07-27 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  8:43 [PATCH V2] mtd: rawnand: brcmnand: propagate init error -EPROBE_DEFER up Rafał Miłecki
2023-07-20 18:52 ` Florian Fainelli
2023-07-21  0:15 ` William Zhang
2023-07-27 15:18 ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.