* [PATCH] drivers/misc: Fix IRQ check
@ 2022-02-10 6:12 cgel.zte
0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2022-02-10 6:12 UTC (permalink / raw)
To: codrin.ciubotariu
Cc: arnd, gregkh, nicolas.ferre, alexandre.belloni,
ludovic.desroches, linux-arm-kernel, linux-kernel, Minghao Chi,
Zeal Robot
From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
platform_get_irq() returns negative error number instead 0 on failure.
Fix the check of return value to catch errors correctly.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
---
drivers/misc/atmel-ssc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index d6cd5537126c..69f9b0336410 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -232,9 +232,9 @@ static int ssc_probe(struct platform_device *pdev)
clk_disable_unprepare(ssc->clk);
ssc->irq = platform_get_irq(pdev, 0);
- if (!ssc->irq) {
+ if (ssc->irq < 0) {
dev_dbg(&pdev->dev, "could not get irq\n");
- return -ENXIO;
+ return ssc->irq;
}
mutex_lock(&user_lock);
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-10 6:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 6:12 [PATCH] drivers/misc: Fix IRQ check cgel.zte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).