From: Varka Bhadram <varkabhadram@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: gnurou@gmail.com, linus.walleij@linaro.org,
Varka Bhadram <varkab@cdac.in>
Subject: [PATCH gpio v2 2/3] gpio: gpio-stp-xway: remove duplicate check on resource
Date: Tue, 28 Oct 2014 12:07:06 +0530 [thread overview]
Message-ID: <1414478227-24674-3-git-send-email-varkab@cdac.in> (raw)
In-Reply-To: <1414478227-24674-1-git-send-email-varkab@cdac.in>
Sanity check on resource happening with devm_ioremap_resource().
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpio/gpio-stp-xway.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index 7e359b7..7892e0f 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -199,21 +199,17 @@ static int xway_stp_hw_init(struct xway_stp *chip)
static int xway_stp_probe(struct platform_device *pdev)
{
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ struct resource *res;
const __be32 *shadow, *groups, *dsl, *phy;
struct xway_stp *chip;
struct clk *clk;
int ret = 0;
- if (!res) {
- dev_err(&pdev->dev, "failed to request STP resource\n");
- return -ENOENT;
- }
-
chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
chip->virt = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(chip->virt))
return PTR_ERR(chip->virt);
--
1.7.9.5
next prev parent reply other threads:[~2014-10-28 6:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-28 6:37 [PATCH gpio v2 0/3] cleanup on resource check Varka Bhadram
2014-10-28 6:37 ` [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource Varka Bhadram
2014-10-31 8:03 ` Linus Walleij
2014-10-28 6:37 ` Varka Bhadram [this message]
2014-10-31 8:05 ` [PATCH gpio v2 2/3] gpio: gpio-stp-xway: " Linus Walleij
2014-10-28 6:37 ` [PATCH gpio v2 3/3] gpio: gpio-tb10x: " Varka Bhadram
2014-10-31 8:05 ` Linus Walleij
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=1414478227-24674-3-git-send-email-varkab@cdac.in \
--to=varkabhadram@gmail.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=varkab@cdac.in \
/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).