diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-08-11 13:56:06 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2022-10-02 13:55:36 +0300 |
commit | 695bfff55327caf6e9b098ada32b39b1d81dafc4 (patch) | |
tree | 5062d7ac5ec4157af064185bc5420f7b85667320 /drivers/watchdog | |
parent | 22b455eecca0a3b73673898099d55db516eddbe1 (diff) | |
download | linux-695bfff55327caf6e9b098ada32b39b1d81dafc4.tar.xz |
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.c | 2 |
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) |