All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect
Date: Mon, 27 Nov 2017 10:31:59 +0100	[thread overview]
Message-ID: <CAPDyKFohj2FBSP8v3WM4YUwfk4FMCeRVRucEsaqjDQ6bq0obwg@mail.gmail.com> (raw)
In-Reply-To: <8fcf045dd4601511186b828d1911ba4659d8f923.1510936216.git.arvind.yadav.cs@gmail.com>

On 17 November 2017 at 17:35, Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:
> platform_get_irq_byname() can fail here and we must check its return value.

NAK.

You need to check the code more carefully. irq_cd is dealt with later
below in the same function with proper error handling.

>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/mmc/host/usdhi6rol0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
> index cdfeb15..5a896de 100644
> --- a/drivers/mmc/host/usdhi6rol0.c
> +++ b/drivers/mmc/host/usdhi6rol0.c
> @@ -1749,7 +1749,7 @@ static int usdhi6_probe(struct platform_device *pdev)
>         irq_cd = platform_get_irq_byname(pdev, "card detect");
>         irq_sd = platform_get_irq_byname(pdev, "data");
>         irq_sdio = platform_get_irq_byname(pdev, "SDIO");
> -       if (irq_sd < 0 || irq_sdio < 0)
> +       if (irq_cd < 0 || irq_sd < 0 || irq_sdio < 0)
>                 return -ENODEV;
>
>         mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);
> --
> 2.7.4
>

  reply	other threads:[~2017-11-27  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17 16:35 [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect Arvind Yadav
2017-11-27  9:31 ` Ulf Hansson [this message]
2017-11-27  9:34   ` Arvind Yadav

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=CAPDyKFohj2FBSP8v3WM4YUwfk4FMCeRVRucEsaqjDQ6bq0obwg@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.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 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.