lkml.org 
[lkml]   [2012]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 3/6] watchdog: omap_wdt: convert request_mem_region() to devm_request_mem_region()
Date
Use devm_request_mem_region() to simplify the code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
drivers/watchdog/omap_wdt.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index d6722db..45019b0 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -217,15 +217,14 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
if (!res)
return -ENOENT;

- mem = request_mem_region(res->start, resource_size(res), pdev->name);
+ mem = devm_request_mem_region(&pdev->dev, res->start,
+ resource_size(res), pdev->name);
if (!mem)
return -EBUSY;

wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL);
- if (!wdev) {
- ret = -ENOMEM;
- goto err_kzalloc;
- }
+ if (!wdev)
+ return -ENOMEM;

omap_wdt->info = &omap_wdt_info;
omap_wdt->ops = &omap_wdt_ops;
@@ -289,9 +288,6 @@ err_misc:
err_ioremap:
wdev->base = NULL;

-err_kzalloc:
- release_mem_region(res->start, resource_size(res));
-
return ret;
}

@@ -316,7 +312,6 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev)

pm_runtime_disable(wdev->dev);
watchdog_unregister_device(wdog);
- release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);

iounmap(wdev->base);
--
1.7.2.5


\
 
 \ /
  Last update: 2012-10-10 22:41    [W:0.050 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site