Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1477340 > unrolled thread

[PATCH] mmc: davinci: remove incorrect NO_IRQ use

Started byArnd Bergmann <arnd@arndb.de>
First post2016-09-06 15:00 +0200
Last post2016-09-09 11:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mmc: davinci: remove incorrect NO_IRQ use Arnd Bergmann <arnd@arndb.de> - 2016-09-06 15:00 +0200
    Re: [PATCH] mmc: davinci: remove incorrect NO_IRQ use Ulf Hansson <ulf.hansson@linaro.org> - 2016-09-09 11:50 +0200

#1477340 — [PATCH] mmc: davinci: remove incorrect NO_IRQ use

FromArnd Bergmann <arnd@arndb.de>
Date2016-09-06 15:00 +0200
Subject[PATCH] mmc: davinci: remove incorrect NO_IRQ use
Message-ID<seo8T-29v-31@gated-at.bofh.it>
platform_get_irq() returns an error value on failure, not NO_IRQ,
so the error handling here could never work.

This changes the code to propagate the error value instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mmc/host/davinci_mmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index c521559412fc..67ef4810b3de 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1216,9 +1216,11 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 	}
 
 	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	irq = platform_get_irq(pdev, 0);
-	if (!r || irq == NO_IRQ)
+	if (!r)
 		return -ENODEV;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	mem_size = resource_size(r);
 	mem = devm_request_mem_region(&pdev->dev, r->start, mem_size,
-- 
2.9.0

[toc] | [next] | [standalone]


#1479808

FromUlf Hansson <ulf.hansson@linaro.org>
Date2016-09-09 11:50 +0200
Message-ID<sfqBA-18C-15@gated-at.bofh.it>
In reply to#1477340
On 6 September 2016 at 14:56, Arnd Bergmann <arnd@arndb.de> wrote:
> platform_get_irq() returns an error value on failure, not NO_IRQ,
> so the error handling here could never work.
>
> This changes the code to propagate the error value instead.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/davinci_mmc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
> index c521559412fc..67ef4810b3de 100644
> --- a/drivers/mmc/host/davinci_mmc.c
> +++ b/drivers/mmc/host/davinci_mmc.c
> @@ -1216,9 +1216,11 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
>         }
>
>         r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       irq = platform_get_irq(pdev, 0);
> -       if (!r || irq == NO_IRQ)
> +       if (!r)
>                 return -ENODEV;
> +       irq = platform_get_irq(pdev, 0);
> +       if (irq < 0)
> +               return irq;
>
>         mem_size = resource_size(r);
>         mem = devm_request_mem_region(&pdev->dev, r->start, mem_size,
> --
> 2.9.0
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web