lkml.org 
[lkml]   [2011]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] spi_imx.c: correct the test on platform_get_irq() return value
On Fri, Jan 7, 2011 at 7:26 AM, Richard Genoud <richard.genoud@gmail.com> wrote:
> The test "if (spi_imx->irq <= 0)" is not testing the IRQ value, but the return value of platform_get_irq().
> As platform_get_irq() can return an error (-ENXIO) or the IRQ value it found, the test should be "if (spi_imx->irq < 0)"
>
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>

For the majority of architectures in Linux, 0 is not a valid IRQ for
devices. Unless there is an actual imx platform that currently
assigns linux irq 0 to the spi controller then I'd rather not apply
this change.

g.

> ---
>  drivers/spi/spi_imx.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
> index 55a38e2..793ae99 100644
> --- a/drivers/spi/spi_imx.c
> +++ b/drivers/spi/spi_imx.c
> @@ -847,7 +847,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
>        }
>
>        spi_imx->irq = platform_get_irq(pdev, 0);
> -       if (spi_imx->irq <= 0) {
> +       if (spi_imx->irq < 0) {
>                ret = -EINVAL;
>                goto out_iounmap;
>        }
> --
> 1.7.1
>
>



--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-01-07 16:29    [from the cache]
©2003-2011 Jasper Spaans