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 3/3] gpio: gpio-tb10x: remove duplicate check on resource
Date: Tue, 28 Oct 2014 12:07:07 +0530 [thread overview]
Message-ID: <1414478227-24674-4-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-tb10x.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 9e615be..8b1e8c0 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -195,18 +195,13 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
if (of_property_read_u32(dn, "abilis,ngpio", &ngpio))
return -EINVAL;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!mem) {
- dev_err(&pdev->dev, "No memory resource defined.\n");
- return -EINVAL;
- }
-
tb10x_gpio = devm_kzalloc(&pdev->dev, sizeof(*tb10x_gpio), GFP_KERNEL);
if (tb10x_gpio == NULL)
return -ENOMEM;
spin_lock_init(&tb10x_gpio->spinlock);
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
tb10x_gpio->base = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(tb10x_gpio->base))
return PTR_ERR(tb10x_gpio->base);
--
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 ` [PATCH gpio v2 2/3] gpio: gpio-stp-xway: " Varka Bhadram
2014-10-31 8:05 ` Linus Walleij
2014-10-28 6:37 ` Varka Bhadram [this message]
2014-10-31 8:05 ` [PATCH gpio v2 3/3] gpio: gpio-tb10x: " 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-4-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).