diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2011-01-07 09:26:01 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-01-07 12:01:23 -0500 |
commit | 735759389b7143f95ae7badc97511e7e4729e873 (patch) | |
tree | 48481675a7d52ce1a1af6bbf6c47fa6095b5a54d | |
parent | 77e58efd134b553d723fd963f436920a6aaaa6df (diff) |
spi/imx: correct the test on platform_get_irq() return value
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)"
[grant.likely: Note: In general, Linux irq number 0 should also mean
no irq, but arm still allows devices to be assigned 0, and the imx
platform uses 0 for one of the spi devices, so this patch is needed
for the device to work]
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
-rw-r--r-- | 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 9010ef0385a8..9469564e6888 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -821,7 +821,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) | |||
821 | } | 821 | } |
822 | 822 | ||
823 | spi_imx->irq = platform_get_irq(pdev, 0); | 823 | spi_imx->irq = platform_get_irq(pdev, 0); |
824 | if (spi_imx->irq <= 0) { | 824 | if (spi_imx->irq < 0) { |
825 | ret = -EINVAL; | 825 | ret = -EINVAL; |
826 | goto out_iounmap; | 826 | goto out_iounmap; |
827 | } | 827 | } |