linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaro Koskinen <aaro.koskinen@iki.fi>
To: wim@iguana.be, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Subject: [RESEND PATCH v3 4/6] watchdog: omap_wdt: convert ioremap() to devm_ioremap()
Date: Mon, 12 Nov 2012 20:47:03 +0200	[thread overview]
Message-ID: <1352746025-1669-5-git-send-email-aaro.koskinen@iki.fi> (raw)
In-Reply-To: <1352746025-1669-1-git-send-email-aaro.koskinen@iki.fi>

Use devm_ioremap() to simplify the code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Wim Van Sebroeck <wim@iguana.be>
---
 drivers/watchdog/omap_wdt.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 45019b0..7e8d3e0 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -255,11 +255,9 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
 	wdev->wdt_trgr_pattern	= 0x1234;
 	mutex_init(&wdev->lock);
 
-	wdev->base = ioremap(res->start, resource_size(res));
-	if (!wdev->base) {
-		ret = -ENOMEM;
-		goto err_ioremap;
-	}
+	wdev->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
+	if (!wdev->base)
+		return -ENOMEM;
 
 	platform_set_drvdata(pdev, omap_wdt);
 
@@ -283,10 +281,6 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
 err_misc:
 	pm_runtime_disable(wdev->dev);
 	platform_set_drvdata(pdev, NULL);
-	iounmap(wdev->base);
-
-err_ioremap:
-	wdev->base = NULL;
 
 	return ret;
 }
@@ -314,8 +308,6 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev)
 	watchdog_unregister_device(wdog);
 	platform_set_drvdata(pdev, NULL);
 
-	iounmap(wdev->base);
-
 	return 0;
 }
 
-- 
1.7.2.5

  parent reply	other threads:[~2012-11-12 18:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 18:46 [RESEND PATCH v3 0/6] watchdog: omap_wdt: convert to new watchdog core Aaro Koskinen
2012-11-12 18:47 ` [RESEND PATCH v3 1/6] " Aaro Koskinen
2012-11-12 22:47   ` Tony Lindgren
2012-12-14  1:23     ` Sebastian Reichel
2012-12-14  1:32       ` Tony Lindgren
2012-12-14  1:47         ` Sebastian Reichel
2012-12-14  1:56       ` Aaro Koskinen
2012-11-12 18:47 ` [RESEND PATCH v3 2/6] watchdog: omap_wdt: convert kzalloc() to devm_kzalloc() Aaro Koskinen
2012-11-12 18:47 ` [RESEND PATCH v3 3/6] watchdog: omap_wdt: convert request_mem_region() to devm_request_mem_region() Aaro Koskinen
2012-11-12 18:47 ` Aaro Koskinen [this message]
2012-11-12 18:47 ` [RESEND PATCH v3 5/6] watchdog: omap_wdt: delete redundant platform_set_drvdata() calls Aaro Koskinen
2012-11-12 18:47 ` [RESEND PATCH v3 6/6] watchdog: omap_wdt: eliminate goto Aaro Koskinen
  -- strict thread matches above, loose matches on Subject: below --
2012-10-25 15:19 [RESEND PATCH v3 0/6] watchdog: omap_wdt: convert to new watchdog core Aaro Koskinen
2012-10-25 15:19 ` [RESEND PATCH v3 4/6] watchdog: omap_wdt: convert ioremap() to devm_ioremap() Aaro Koskinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352746025-1669-5-git-send-email-aaro.koskinen@iki.fi \
    --to=aaro.koskinen@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).