Skip to content

Commit 7357593

Browse files
rgenoudglikely
authored andcommitted
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
1 parent 77e58ef commit 7357593

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi_imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
821821
}
822822

823823
spi_imx->irq = platform_get_irq(pdev, 0);
824-
if (spi_imx->irq <= 0) {
824+
if (spi_imx->irq < 0) {
825825
ret = -EINVAL;
826826
goto out_iounmap;
827827
}

0 commit comments

Comments
 (0)