linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: kyungmin.park@samsung.com, richard@nod.at, vigneshr@ti.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: onenand: Check for error irq
Date: Mon, 3 Jan 2022 16:56:20 +0100	[thread overview]
Message-ID: <20220103165620.2eadfc4c@xps13> (raw)
In-Reply-To: <20211224022321.1470969-1-jiasheng@iscas.ac.cn>

Hi Jiasheng,

jiasheng@iscas.ac.cn wrote on Fri, 24 Dec 2021 10:23:21 +0800:

> For the possible failure of the platform_get_irq(), the returned irq
> could be error number and will finally cause the failure of the
> request_irq().
> Consider that platform_get_irq() can now in certain cases return
> -EPROBE_DEFER, and the consequences of letting request_irq() effectively
> convert that into -EINVAL, even at probe time rather than later on.
> So it might be better to check just now.
> 
> Fixes: 26777d37216c ("mtd: Move onenand code base to drivers/mtd/nand/onenand")

This is not the root cause.

> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/mtd/nand/onenand/generic.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/onenand/generic.c b/drivers/mtd/nand/onenand/generic.c
> index 8b6f4da5d720..a4b8b65fe15f 100644
> --- a/drivers/mtd/nand/onenand/generic.c
> +++ b/drivers/mtd/nand/onenand/generic.c
> @@ -53,7 +53,12 @@ static int generic_onenand_probe(struct platform_device *pdev)
>  	}
>  
>  	info->onenand.mmcontrol = pdata ? pdata->mmcontrol : NULL;
> -	info->onenand.irq = platform_get_irq(pdev, 0);
> +
> +	err = platform_get_irq(pdev, 0);
> +	if (err < 0)
> +		goto out_iounmap;
> +
> +	info->onenand.irq = err;
>  
>  	info->mtd.dev.parent = &pdev->dev;
>  	info->mtd.priv = &info->onenand;

Otherwise looks fine.

Thanks,
Miquèl

      reply	other threads:[~2022-01-03 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-24  2:23 [PATCH] mtd: onenand: Check for error irq Jiasheng Jiang
2022-01-03 15:56 ` Miquel Raynal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220103165620.2eadfc4c@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).