diff mbox series

[v1,1/1] spi: ppc4xx: Avoid returning 0 when failed to parse and map IRQ

Message ID 20240813160220.2357338-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/1] spi: ppc4xx: Avoid returning 0 when failed to parse and map IRQ | expand

Commit Message

Andy Shevchenko Aug. 13, 2024, 4:02 p.m. UTC
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>
---
 drivers/spi/spi-ppc4xx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Andy Shevchenko Aug. 13, 2024, 6:29 p.m. UTC | #1
On Tue, Aug 13, 2024 at 07:02:20PM +0300, Andy Shevchenko wrote:
> 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.

Scratch it, it has the same issue and it seems it predates the mentioned patch
as we need to return a real error code.
diff mbox series

Patch

diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
index 01fdecbf132d..e75a571ae1ba 100644
--- a/drivers/spi/spi-ppc4xx.c
+++ b/drivers/spi/spi-ppc4xx.c
@@ -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,8 +411,8 @@  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)
+	hw->irqnum = platform_get_irq(op, 0);
+	if (hw->irqnum < 0)
 		goto free_host;
 
 	ret = request_irq(hw->irqnum, spi_ppc4xx_int,