]> www.infradead.org Git - linux.git/commitdiff
spi: ppc4xx: Avoid returning 0 when failed to parse and map IRQ
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 14 Aug 2024 14:45:12 +0000 (17:45 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 14 Aug 2024 17:26:50 +0000 (18:26 +0100)
0 is incorrect error code when failed to parse and map IRQ.
Replace OF specific old API for IRQ retrieval with a generic
one to fix this issue.

Fixes: 0f245463b01e ("spi: ppc4xx: handle irq_of_parse_and_map() errors")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20240814144525.2648450-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ppc4xx.c

index 599c29a312690e5b5b7170714b722d93eb69ef2b..6071f83dd9c849ba75129ccb655f2588df2fded8 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/wait.h>
 #include <linux/platform_device.h>
 #include <linux/of_address.h>
-#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
@@ -412,9 +411,10 @@ static int spi_ppc4xx_of_probe(struct platform_device *op)
        }
 
        /* Request IRQ */
-       hw->irqnum = irq_of_parse_and_map(np, 0);
-       if (hw->irqnum <= 0)
+       ret = platform_get_irq(op, 0);
+       if (ret < 0)
                goto free_host;
+       hw->irqnum = ret;
 
        if (hw->irqnum <= 0)
                goto free_host;