summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2014-02-11 21:45:56 +0900
committerWim Van Sebroeck <wim@iguana.be>2014-03-31 13:24:57 +0200
commit9d11e4f8c3353088ace2f80bec85bb0e2f316382 (patch)
treee9612c0f1cb1ca1081735a31ed8f7d5d101d42e2 /drivers
parent6e272061391946fe28cadd5f9fbab1bab82b3748 (diff)
watchdog: sp805_wdt: Use devm_ioremap_resource()
Use devm_ioremap_resource() in order to make the code simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/watchdog/sp805_wdt.c17
1 files changed, 3 insertions, 14 deletions
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)) {