summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-08-11 12:56:06 +0200
committerWim Van Sebroeck <wim@linux-watchdog.org>2022-10-02 12:55:36 +0200
commit695bfff55327caf6e9b098ada32b39b1d81dafc4 (patch)
tree5062d7ac5ec4157af064185bc5420f7b85667320 /drivers/watchdog
parentdt-bindings: watchdog: renesas-wdt: Add r8a779g0 support (diff)
downloadlinux-695bfff55327caf6e9b098ada32b39b1d81dafc4.tar.xz
linux-695bfff55327caf6e9b098ada32b39b1d81dafc4.zip
watchdog: ftwdt010_wdt: fix test for platform_get_irq() failure
This code assumes that platform_get_irq() function returns zero on failure. In fact, platform_get_irq() never returns zero. It returns negative error codes or positive non-zero values on success. Fixes: eca10ae6000d ("watchdog: add driver for Cortina Gemini watchdog") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/YvTgRk/ABp62/hNA@kili Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/ftwdt010_wdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/watchdog/ftwdt010_wdt.c b/drivers/watchdog/ftwdt010_wdt.c
index 0a5bbfd2823f..442c5bf63ff4 100644
--- a/drivers/watchdog/ftwdt010_wdt.c
+++ b/drivers/watchdog/ftwdt010_wdt.c
@@ -171,7 +171,7 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
- if (irq) {
+ if (irq > 0) {
ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0,
"watchdog bark", gwdt);
if (ret)