[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1362416898.24058.1.camel@gitbox>
Date: Tue, 05 Mar 2013 06:08:18 +1300
From: Tony Prisk <linux@...sktech.co.nz>
To: Sachin Kamat <sachin.kamat@...aro.org>
Cc: linux-kernel@...r.kernel.org, grant.likely@...retlab.ca,
linus.walleij@...aro.org, thierry.reding@...onic-design.de
Subject: Re: [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
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@...aro.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@...sktech.co.nz>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists