From: George Cherian <george.cherian@ti.com>
To: <wim@iguana.be>
Cc: <linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
George Cherian <george.cherian@ti.com>
Subject: [PATCH 3/3] watchdog: shwdt: Remove the unnecessary check of resource after platform_get_resource()
Date: Tue, 10 Jun 2014 10:10:08 +0530 [thread overview]
Message-ID: <1402375208-18445-3-git-send-email-george.cherian@ti.com> (raw)
In-Reply-To: <1402375208-18445-1-git-send-email-george.cherian@ti.com>
devm_ioremap_resource check for a valid resource. Remove the unnecessary check.
Also group platform_get_resource and devm_ioremap_resource together for better
readability.
Signed-off-by: George Cherian <george.cherian@ti.com>
---
drivers/watchdog/shwdt.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index d04d02b..08205d7 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -230,10 +230,6 @@ static int sh_wdt_probe(struct platform_device *pdev)
if (pdev->id != -1)
return -EINVAL;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (unlikely(!res))
- return -EINVAL;
-
wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL);
if (unlikely(!wdt))
return -ENOMEM;
@@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
wdt->clk = NULL;
}
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
wdt->base = devm_ioremap_resource(wdt->dev, res);
if (IS_ERR(wdt->base))
return PTR_ERR(wdt->base);
--
1.8.3.1
next prev parent reply other threads:[~2014-06-10 4:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 4:40 [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
2014-06-10 4:40 ` [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
2014-06-10 19:23 ` Guenter Roeck
2014-06-10 4:40 ` George Cherian [this message]
2014-06-10 19:24 ` [PATCH 3/3] watchdog: shwdt: Remove the unnecessary " Guenter Roeck
2014-06-10 19:23 ` [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
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=1402375208-18445-3-git-send-email-george.cherian@ti.com \
--to=george.cherian@ti.com \
--cc=linux-kernel@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).