diff mbox

drivers: gpio: Use devm_ioremap_resource function

Message ID 1363253249-3128-1-git-send-email-gheorghiuandru@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexandru Gheorghiu March 14, 2013, 9:27 a.m. UTC
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error
handling.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
---
 drivers/gpio/gpio-vt8500.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sachin Kamat March 14, 2013, 9:34 a.m. UTC | #1
On 14 March 2013 14:57, Alexandru Gheorghiu <gheorghiuandru@gmail.com> 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 <gheorghiuandru@gmail.com>

Similar patch has already been submitted:
https://lkml.org/lkml/2013/3/4/124
Linus Walleij March 27, 2013, 8:42 a.m. UTC | #2
On Thu, Mar 14, 2013 at 10:34 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> On 14 March 2013 14:57, Alexandru Gheorghiu <gheorghiuandru@gmail.com> 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 <gheorghiuandru@gmail.com>
>
> Similar patch has already been submitted:
> https://lkml.org/lkml/2013/3/4/124

I've applied the earlier patch.

Yours,
Linus Walleij
diff mbox

Patch

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);