summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2023-07-19 10:43:24 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-07-27 17:02:01 +0200
commit6680d8b67921fc732a59792dec6d3f94c031451c (patch)
tree8c9a3d6755009d8e2c91ac2f0bad89cccf227895 /drivers/mtd/nand
parent0e1db39336d8be4ddeb9f0d99720056f3ff41310 (diff)
downloadlwn-6680d8b67921fc732a59792dec6d3f94c031451c.tar.gz
lwn-6680d8b67921fc732a59792dec6d3f94c031451c.zip
mtd: rawnand: brcmnand: propagate init error -EPROBE_DEFER up
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> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> Acked-by: William Zhang <william.zhang@broadcom.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230719084324.14799-1-zajec5@gmail.com
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/raw/brcmnand/brcmnand.c4
1 files changed, 4 insertions, 0 deletions
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 */
}