Commit 9d11e4f8 authored by Jingoo Han's avatar Jingoo Han Committed by Wim Van Sebroeck

watchdog: sp805_wdt: Use devm_ioremap_resource()

Use devm_ioremap_resource() in order to make the code simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 6e272061
...@@ -208,26 +208,15 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -208,26 +208,15 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
struct sp805_wdt *wdt; struct sp805_wdt *wdt;
int ret = 0; 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); wdt = devm_kzalloc(&adev->dev, sizeof(*wdt), GFP_KERNEL);
if (!wdt) { if (!wdt) {
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
} }
wdt->base = devm_ioremap(&adev->dev, adev->res.start, wdt->base = devm_ioremap_resource(&adev->dev, &adev->res);
resource_size(&adev->res)); if (IS_ERR(wdt->base))
if (!wdt->base) { return PTR_ERR(wdt->base);
ret = -ENOMEM;
dev_warn(&adev->dev, "ioremap fail\n");
goto err;
}
wdt->clk = devm_clk_get(&adev->dev, NULL); wdt->clk = devm_clk_get(&adev->dev, NULL);
if (IS_ERR(wdt->clk)) { if (IS_ERR(wdt->clk)) {
......
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