2013-03-14 09:28:12

by Alexandru Gheorghiu

[permalink] [raw]
Subject: [PATCH] drivers: gpio: Use devm_ioremap_resource function

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error
handling.

Signed-off-by: Alexandru Gheorghiu <[email protected]>
---
drivers/gpio/gpio-vt8500.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-vt8500.c b/drivers/gpio/gpio-vt8500.c
index 81683ca..eaed4ac 100644
--- a/drivers/gpio/gpio-vt8500.c
+++ b/drivers/gpio/gpio-vt8500.c
@@ -309,10 +309,10 @@ static int vt8500_gpio_probe(struct platform_device *pdev)
return -ENODEV;
}

- gpio_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!gpio_base) {
+ gpio_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(gpio_base)) {
dev_err(&pdev->dev, "Unable to map GPIO registers\n");
- return -ENOMEM;
+ return PTR_ERR(gpio_base);
}

ret = vt8500_add_chips(pdev, gpio_base, of_id->data);
--
1.7.9.5


2013-03-14 09:34:28

by Sachin Kamat

[permalink] [raw]
Subject: Re: [PATCH] drivers: gpio: Use devm_ioremap_resource function

On 14 March 2013 14:57, Alexandru Gheorghiu <[email protected]> wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error
> handling.
>
> Signed-off-by: Alexandru Gheorghiu <[email protected]>

Similar patch has already been submitted:
https://lkml.org/lkml/2013/3/4/124

2013-03-27 08:42:57

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] drivers: gpio: Use devm_ioremap_resource function

On Thu, Mar 14, 2013 at 10:34 AM, Sachin Kamat <[email protected]> wrote:
> On 14 March 2013 14:57, Alexandru Gheorghiu <[email protected]> wrote:
>> Use the newly introduced devm_ioremap_resource() instead of
>> devm_request_and_ioremap() which provides more consistent error
>> handling.
>>
>> Signed-off-by: Alexandru Gheorghiu <[email protected]>
>
> Similar patch has already been submitted:
> https://lkml.org/lkml/2013/3/4/124

I've applied the earlier patch.

Yours,
Linus Walleij