Commit 4a22fc53 authored by Dan Carpenter's avatar Dan Carpenter Committed by Wim Van Sebroeck

watchdog: tqmx86: Fix a couple IS_ERR() vs NULL bugs

These functions return NULL on error but we accidentally check
for IS_ERR() instead.

Fixes: e3c21e08 ("watchdog: tqmx86: Add watchdog driver for the IO controller")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 3aa8b8bb
...@@ -79,13 +79,13 @@ static int tqmx86_wdt_probe(struct platform_device *pdev) ...@@ -79,13 +79,13 @@ static int tqmx86_wdt_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_IO, 0); res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (IS_ERR(res)) if (!res)
return PTR_ERR(res); return -ENODEV;
priv->io_base = devm_ioport_map(&pdev->dev, res->start, priv->io_base = devm_ioport_map(&pdev->dev, res->start,
resource_size(res)); resource_size(res));
if (IS_ERR(priv->io_base)) if (!priv->io_base)
return PTR_ERR(priv->io_base); return -ENOMEM;
watchdog_set_drvdata(&priv->wdd, priv); watchdog_set_drvdata(&priv->wdd, priv);
......
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