Skip to contentSkip to conversation

soc: aspeed: fix platform_get_irq() error checking

PATCH New Dan Carpenter 1 participant 1 message Aug 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: aspeed: fix platform_get_irq() error checking

The platform_get_irq() function returns negative error codes but this code is testing for zero instead.

Fixes 9f4f9ae81d0a ("drivers/misc: add Aspeed LPC snoop driver")
---
 drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/aspeed/aspeed-lpc-snoop.c +2 -2
index eceeaf8dfbeb..c4a03b3a5cf8 100644
@@ -167,8 +167,8 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
 	int rc;
 
 	lpc_snoop->irq = platform_get_irq(pdev, 0);
-	if (!lpc_snoop->irq)
-		return -ENODEV;
+	if (lpc_snoop->irq < 0)
+		return lpc_snoop->irq;
 
 	rc = devm_request_irq(dev, lpc_snoop->irq,
 			      aspeed_lpc_snoop_irq, IRQF_SHARED,
Signature · 1 line
2.35.1