Use the newly introduced devm_ioremap_resource() instead of devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/watchdog/davinci_wdt.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index 7df1fdc..100d4fb 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c @@ -27,6 +27,7 @@ #include <linux/device.h> #include <linux/clk.h> #include <linux/slab.h> +#include <linux/err.h> #define MODULE_NAME "DAVINCI-WDT: " @@ -221,11 +222,9 @@ static int davinci_wdt_probe(struct platform_device *pdev) return -ENOENT; } - wdt_base = devm_request_and_ioremap(dev, wdt_mem); - if (!wdt_base) { - dev_err(dev, "ioremap failed\n"); - return -EADDRNOTAVAIL; - } + wdt_base = devm_ioremap_resource(dev, wdt_mem); + if (IS_ERR(wdt_base)) + return PTR_ERR(wdt_base); ret = misc_register(&davinci_wdt_miscdev); if (ret < 0) { -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html