All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: 'Wim Van Sebroeck' <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org,
	'Guenter Roeck' <linux@roeck-us.net>,
	'Jingoo Han' <jg1.han@samsung.com>,
	'H Hartley Sweeten' <hsweeten@visionengravers.com>
Subject: [PATCH 1/3] watchdog: ep93xx_wdt: Use devm_ioremap_resource()
Date: Tue, 11 Feb 2014 21:41:54 +0900	[thread overview]
Message-ID: <000e01cf2726$a511a030$ef34e090$%han@samsung.com> (raw)

Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because the value is checked by devm_ioremap_resource().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/watchdog/ep93xx_wdt.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c
index d1d07f2..5e4f3de 100644
--- a/drivers/watchdog/ep93xx_wdt.c
+++ b/drivers/watchdog/ep93xx_wdt.c
@@ -118,16 +118,9 @@ static int ep93xx_wdt_probe(struct platform_device *pdev)
 	int err;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENXIO;
-
-	if (!devm_request_mem_region(&pdev->dev, res->start,
-				     resource_size(res), pdev->name))
-		return -EBUSY;
-
-	mmio_base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
-	if (!mmio_base)
-		return -ENXIO;
+	mmio_base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(mmio_base))
+		return PTR_ERR(mmio_base);
 
 	if (timeout < 1 || timeout > 3600) {
 		timeout = WDT_TIMEOUT;
-- 
1.7.10.4



             reply	other threads:[~2014-02-11 12:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 12:41 Jingoo Han [this message]
2014-02-11 12:44 ` [PATCH 2/3] watchdog: omap_wdt: Use devm_ioremap_resource() Jingoo Han
2014-02-11 20:30   ` Guenter Roeck
2014-02-11 20:58   ` Aaro Koskinen
2014-02-24 19:55   ` Wim Van Sebroeck
2014-02-11 12:45 ` [PATCH 3/3] watchdog: sp805_wdt: " Jingoo Han
2014-02-11 20:31   ` Guenter Roeck
2014-02-24 19:55   ` Wim Van Sebroeck
2014-02-11 20:29 ` [PATCH 1/3] watchdog: ep93xx_wdt: " Guenter Roeck
2014-02-24 19:55 ` Wim Van Sebroeck

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='000e01cf2726$a511a030$ef34e090$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.