mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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: eca10ae600
("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>
This commit is contained in:
parent
22b455eecc
commit
695bfff553
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user