From: Tony Prisk <linux@prisktech.co.nz>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-kernel@vger.kernel.org, grant.likely@secretlab.ca,
linus.walleij@linaro.org, thierry.reding@avionic-design.de
Subject: Re: [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
Date: Tue, 05 Mar 2013 06:08:18 +1300 [thread overview]
Message-ID: <1362416898.24058.1.camel@gitbox> (raw)
In-Reply-To: <1362388179-26841-1-git-send-email-sachin.kamat@linaro.org>
On Mon, 2013-03-04 at 14:39 +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/gpio/gpio-vt8500.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpio/gpio-vt8500.c b/drivers/gpio/gpio-vt8500.c
> index 81683ca..b2d8d6f 100644
> --- a/drivers/gpio/gpio-vt8500.c
> +++ b/drivers/gpio/gpio-vt8500.c
> @@ -309,11 +309,9 @@ static int vt8500_gpio_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> - gpio_base = devm_request_and_ioremap(&pdev->dev, res);
> - if (!gpio_base) {
> - dev_err(&pdev->dev, "Unable to map GPIO registers\n");
> - return -ENOMEM;
> - }
> + gpio_base = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(gpio_base))
> + return PTR_ERR(gpio_base);
>
> ret = vt8500_add_chips(pdev, gpio_base, of_id->data);
>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
next prev parent reply other threads:[~2013-03-04 17:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 9:09 [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource() Sachin Kamat
2013-03-04 10:24 ` Thierry Reding
2013-03-04 17:08 ` Tony Prisk [this message]
2013-03-14 6:45 ` Sachin Kamat
2013-03-27 8:32 ` 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=1362416898.24058.1.camel@gitbox \
--to=linux@prisktech.co.nz \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sachin.kamat@linaro.org \
--cc=thierry.reding@avionic-design.de \
/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).