[PATCH] ARM: pxa: fix platform_get_irq error checking

Yu Zhe yuzhe at nfschina.com
Thu Sep 8 20:27:58 PDT 2022


The platform_get_irq() function returns negative error codes on error,
so change the '<=0' check to '<0' to make code more explicit.

Signed-off-by: Yu Zhe <yuzhe at nfschina.com>
---
 arch/arm/mach-pxa/pxa_cplds_irqs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c
index eda5a47d7fbb..aa284031071d 100644
--- a/arch/arm/mach-pxa/pxa_cplds_irqs.c
+++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c
@@ -115,7 +115,7 @@ static int cplds_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	fpga->irq = platform_get_irq(pdev, 0);
-	if (fpga->irq <= 0)
+	if (fpga->irq < 0)
 		return fpga->irq;
 
 	base_irq = platform_get_irq(pdev, 1);
-- 
2.11.0




More information about the linux-arm-kernel mailing list