* [PATCH] soc: aspeed: fix platform_get_irq() error checking
@ 2022-08-11 11:00 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2022-08-11 11:00 UTC (permalink / raw)
To: Joel Stanley, Robert Lippert
Cc: Andrew Jeffery, linux-aspeed, kernel-janitors
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/soc/aspeed/aspeed-lpc-snoop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c
index eceeaf8dfbeb..c4a03b3a5cf8 100644
--- a/drivers/soc/aspeed/aspeed-lpc-snoop.c
+++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c
@@ -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,
--
2.35.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-11 11:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 11:00 [PATCH] soc: aspeed: fix platform_get_irq() error checking Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.