[PATCH V2] mtd: rawnand: brcmnand: propagate init error -EPROBE_DEFER up

William Zhang william.zhang at broadcom.com
Thu Jul 20 17:15:30 PDT 2023



On 07/19/2023 01:43 AM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at 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 at 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 */
>   			}
> 

Acked-by: William Zhang <william.zhang at broadcom.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4212 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20230720/fb22d7fd/attachment.p7s>


More information about the linux-mtd mailing list