[PATCH 2/5] spi-imx: correct check for platform_get_irq failing

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Dec 8 16:14:07 EST 2009


platform_get_irq returns -ENXIO if there is no entry.  So don't check
return value being nonzero but greater or equal to zero.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Cc: David Brownell <dbrownell at users.sourceforge.net>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Sascha Hauer <s.hauer at pengutronix.de>
---
 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 c83ca05..d8d9a35 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -554,7 +554,7 @@ static int __init spi_imx_probe(struct platform_device *pdev)
 	}
 
 	spi_imx->irq = platform_get_irq(pdev, 0);
-	if (!spi_imx->irq) {
+	if (spi_imx->irq < 0) {
 		ret = -EINVAL;
 		goto out_iounmap;
 	}
-- 
1.6.5.2




More information about the linux-arm-kernel mailing list