Commit 695bfff5 authored by Dan Carpenter's avatar Dan Carpenter Committed by Wim Van Sebroeck

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: eca10ae6 ("watchdog: add driver for Cortina Gemini watchdog")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/YvTgRk/ABp62/hNA@kiliSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 22b455ee
...@@ -171,7 +171,7 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev) ...@@ -171,7 +171,7 @@ static int ftwdt010_wdt_probe(struct platform_device *pdev)
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq) { if (irq > 0) {
ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0, ret = devm_request_irq(dev, irq, ftwdt010_wdt_interrupt, 0,
"watchdog bark", gwdt); "watchdog bark", gwdt);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment