From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: Jingoo Han <jg1.han@samsung.com>
Cc: 'Linus Walleij' <linus.walleij@linaro.org>,
'Alexandre Courbot' <gnurou@gmail.com>,
linux-gpio@vger.kernel.org,
'Kevin Hilman' <khilman@deeprootsystems.com>
Subject: Re: [PATCH 1/2] gpio/omap: Use devm_ioremap_resource()
Date: Fri, 14 Feb 2014 17:55:27 -0500 [thread overview]
Message-ID: <52FE9EDF.2030509@ti.com> (raw)
In-Reply-To: <000001cf279d$599a8000$0ccf8000$%han@samsung.com>
On Tuesday 11 February 2014 09:51 PM, Jingoo Han wrote:
> Use devm_ioremap_resource() in order to make the code simpler,
> and remove redundant return value check of platform_get_resource()
> because the value is checked by devm_ioremap_resource().
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> drivers/gpio/gpio-omap.c | 20 +++-----------------
> 1 file changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 4243190..19b886c 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1214,24 +1214,10 @@ static int omap_gpio_probe(struct platform_device *pdev)
>
> /* Static mapping, never released */
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (unlikely(!res)) {
> - dev_err(dev, "Invalid mem resource\n");
> - irq_domain_remove(bank->domain);
> - return -ENODEV;
> - }
> -
> - if (!devm_request_mem_region(dev, res->start, resource_size(res),
> - pdev->name)) {
> - dev_err(dev, "Region already claimed\n");
> + bank->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(bank->base)) {
> irq_domain_remove(bank->domain);
> - return -EBUSY;
> - }
> -
> - bank->base = devm_ioremap(dev, res->start, resource_size(res));
> - if (!bank->base) {
> - dev_err(dev, "Could not ioremap\n");
> - irq_domain_remove(bank->domain);
> - return -ENOMEM;
> + return PTR_ERR(bank->base);
> }
>
> platform_set_drvdata(pdev, bank);
>
next prev parent reply other threads:[~2014-02-14 22:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 2:51 [PATCH 1/2] gpio/omap: Use devm_ioremap_resource() Jingoo Han
2014-02-12 2:53 ` [PATCH 2/2] gpio: pl061: " Jingoo Han
2014-02-12 4:25 ` Alexandre Courbot
2014-02-24 12:16 ` Linus Walleij
2014-02-12 4:24 ` [PATCH 1/2] gpio/omap: " Alexandre Courbot
2014-02-14 21:34 ` Kevin Hilman
2014-02-14 22:55 ` Santosh Shilimkar [this message]
2014-02-24 13:45 ` 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=52FE9EDF.2030509@ti.com \
--to=santosh.shilimkar@ti.com \
--cc=gnurou@gmail.com \
--cc=jg1.han@samsung.com \
--cc=khilman@deeprootsystems.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
/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).