From 4c271bb67c04253c1e99006eb48fb773a8fe8c0f Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Mon, 21 Jan 2013 11:09:25 +0100 Subject: 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 Cc: Wim Van Sebroeck Signed-off-by: Greg Kroah-Hartman --- drivers/watchdog/max63xx_wdt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/watchdog/max63xx_wdt.c') diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c index 773c661723ca..cc9d328086ed 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 #include #include #include @@ -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); -- cgit v1.2.3