* [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
@ 2013-03-04 9:09 Sachin Kamat
2013-03-04 10:24 ` Thierry Reding
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sachin Kamat @ 2013-03-04 9:09 UTC (permalink / raw)
To: linux-kernel
Cc: linux, grant.likely, linus.walleij, sachin.kamat, thierry.reding
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);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
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
2013-03-27 8:32 ` Linus Walleij
2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2013-03-04 10:24 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-kernel, linux, grant.likely, linus.walleij
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
On Mon, Mar 04, 2013 at 02:39:39PM +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(-)
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
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
2013-03-14 6:45 ` Sachin Kamat
2013-03-27 8:32 ` Linus Walleij
2 siblings, 1 reply; 5+ messages in thread
From: Tony Prisk @ 2013-03-04 17:08 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-kernel, grant.likely, linus.walleij, thierry.reding
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
2013-03-04 17:08 ` Tony Prisk
@ 2013-03-14 6:45 ` Sachin Kamat
0 siblings, 0 replies; 5+ messages in thread
From: Sachin Kamat @ 2013-03-14 6:45 UTC (permalink / raw)
To: grant.likely, linus.walleij; +Cc: linux-kernel
Hi Linus,
On 4 March 2013 22:38, Tony Prisk <linux@prisktech.co.nz> wrote:
> 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>
> Acked-by: Tony Prisk <linux@prisktech.co.nz>
Would you be picking this patch up or Grant is gonna handle it?
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] gpio/vt8500: Convert to devm_ioremap_resource()
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
@ 2013-03-27 8:32 ` Linus Walleij
2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2013-03-27 8:32 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-kernel, linux, grant.likely, thierry.reding
On Mon, Mar 4, 2013 at 10:09 AM, Sachin Kamat <sachin.kamat@linaro.org> 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>
Patch applied with Tony's and Thierry's ACKs/Reviewed-by.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-27 8:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-03-14 6:45 ` Sachin Kamat
2013-03-27 8:32 ` Linus Walleij
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).