diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2013-01-21 11:09:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-25 12:21:48 -0800 |
commit | 4c271bb67c04253c1e99006eb48fb773a8fe8c0f (patch) | |
tree | 5a05de9c0bd07e0ddc29e9312fec52c3c741d041 /drivers/watchdog/max63xx_wdt.c | |
parent | ca36b1ba8c92cbab6f6568283071262592603d59 (diff) |
watchdog: Convert to devm_ioremap_resource()
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/watchdog/max63xx_wdt.c')
-rw-r--r-- | drivers/watchdog/max63xx_wdt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c index 773c661723c..cc9d328086e 100644 --- a/drivers/watchdog/max63xx_wdt.c +++ b/drivers/watchdog/max63xx_wdt.c @@ -14,6 +14,7 @@ * another interface, some abstraction will have to be introduced. */ +#include <linux/err.h> #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/types.h> @@ -198,9 +199,9 @@ static int max63xx_wdt_probe(struct platform_device *pdev) heartbeat = current_timeout->twd; wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - wdt_base = devm_request_and_ioremap(&pdev->dev, wdt_mem); - if (!wdt_base) - return -ENOMEM; + wdt_base = devm_ioremap_resource(&pdev->dev, wdt_mem); + if (IS_ERR(wdt_base)) + return PTR_ERR(wdt_base); max63xx_wdt_dev.timeout = heartbeat; watchdog_set_nowayout(&max63xx_wdt_dev, nowayout); |