From: Jingoo Han Date: Tue, 11 Feb 2014 12:45:56 +0000 (+0900) Subject: watchdog: sp805_wdt: Use devm_ioremap_resource() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d11e4f8c3353088ace2f80bec85bb0e2f316382;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git watchdog: sp805_wdt: Use devm_ioremap_resource() Use devm_ioremap_resource() in order to make the code simpler. Signed-off-by: Jingoo Han Reviewed-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 9a645d6c9d96..47629d268e0a 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -208,26 +208,15 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) struct sp805_wdt *wdt; int ret = 0; - if (!devm_request_mem_region(&adev->dev, adev->res.start, - resource_size(&adev->res), "sp805_wdt")) { - dev_warn(&adev->dev, "Failed to get memory region resource\n"); - ret = -ENOENT; - goto err; - } - wdt = devm_kzalloc(&adev->dev, sizeof(*wdt), GFP_KERNEL); if (!wdt) { ret = -ENOMEM; goto err; } - wdt->base = devm_ioremap(&adev->dev, adev->res.start, - resource_size(&adev->res)); - if (!wdt->base) { - ret = -ENOMEM; - dev_warn(&adev->dev, "ioremap fail\n"); - goto err; - } + wdt->base = devm_ioremap_resource(&adev->dev, &adev->res); + if (IS_ERR(wdt->base)) + return PTR_ERR(wdt->base); wdt->clk = devm_clk_get(&adev->dev, NULL); if (IS_ERR(wdt->clk)) {