Skip to content

Commit

Permalink
spi: ppc4xx: Avoid returning 0 when failed to parse and map IRQ
Browse files Browse the repository at this point in the history
[ Upstream commit 7781f1d120fec8624fc654eda900fc8748262082 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit e546902c4917656203e0e134630a873e9b6d28af)
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
  • Loading branch information
andy-shev authored and selfmusing committed Feb 17, 2025
1 parent ecf4bda commit 033f49a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi-ppc4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/errno.h>
#include <linux/wait.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -494,9 +493,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;

ret = request_irq(hw->irqnum, spi_ppc4xx_int,
0, "spi_ppc4xx_of", (void *)hw);
Expand Down

0 comments on commit 033f49a

Please sign in to comment.