[PATCH] mpc832x_rdb: fix of_irq_to_resource() error check

Sergei Shtylyov sergei.shtylyov at cogentembedded.com
Sun Jul 30 05:52:09 AEST 2017


of_irq_to_resource() has recently been  fixed to return negative error #'s
along with 0 in case of failure,  however the Freescale MPC832x RDB board
code still only regards 0 as as failure indication -- fix it up.

Fixes: 7a4228bbff76 ("of: irq: use of_irq_get() in of_irq_to_resource()")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov at cogentembedded.com>

---
The patch is against the 'master' branch of Scott Wood's 'linux.git' repo
(the 'fixes' branch is too much behind).

 arch/powerpc/platforms/83xx/mpc832x_rdb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/arch/powerpc/platforms/83xx/mpc832x_rdb.c
===================================================================
--- linux.orig/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ linux/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -89,7 +89,7 @@ static int __init of_fsl_spi_probe(char
 			goto err;
 
 		ret = of_irq_to_resource(np, 0, &res[1]);
-		if (!ret)
+		if (ret <= 0)
 			goto err;
 
 		pdev = platform_device_alloc("mpc83xx_spi", i);



More information about the Linuxppc-dev mailing list