From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Sonic Zhang <sonic.zhang@analog.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] pinctrl: adi2: Convert to devm_ioremap_resource
Date: Tue, 24 Sep 2013 15:46:11 +0800 [thread overview]
Message-ID: <1380008771.28920.1.camel@phoenix> (raw)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/pinctrl/pinctrl-adi2.c | 38 ++++++--------------------------------
1 file changed, 6 insertions(+), 32 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index 7a24e59..f2aa877 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -855,22 +855,9 @@ static int adi_gpio_pint_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "Invalid mem resource\n");
- return -ENODEV;
- }
-
- if (!devm_request_mem_region(dev, res->start, resource_size(res),
- pdev->name)) {
- dev_err(dev, "Region already claimed\n");
- return -EBUSY;
- }
-
- pint->base = devm_ioremap(dev, res->start, resource_size(res));
- if (!pint->base) {
- dev_err(dev, "Could not ioremap\n");
- return -ENOMEM;
- }
+ pint->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(pint->base))
+ return PTR_ERR(pint->base);
pint->regs = (struct gpio_pint_regs *)pint->base;
@@ -984,22 +971,9 @@ static int adi_gpio_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- dev_err(dev, "Invalid mem resource\n");
- return -ENODEV;
- }
-
- if (!devm_request_mem_region(dev, res->start, resource_size(res),
- pdev->name)) {
- dev_err(dev, "Region already claimed\n");
- return -EBUSY;
- }
-
- port->base = devm_ioremap(dev, res->start, resource_size(res));
- if (!port->base) {
- dev_err(dev, "Could not ioremap\n");
- return -ENOMEM;
- }
+ port->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(port->base))
+ return PTR_ERR(port->base);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res)
--
1.8.1.2
next reply other threads:[~2013-09-24 7:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-24 7:46 Axel Lin [this message]
2013-09-24 7:47 ` [PATCH 2/2] pinctrl: adi2: Fix dead lock in adi_gpio_direction_output Axel Lin
2013-09-27 12:20 ` Linus Walleij
2013-10-08 2:59 ` Sonic Zhang
2013-09-27 12:19 ` [PATCH 1/2] pinctrl: adi2: Convert to devm_ioremap_resource 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=1380008771.28920.1.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sonic.zhang@analog.com \
/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.