Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio/vt8500: Convert to devm_ioremap_resource()

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>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Sachin Kamat and committed by
Linus Walleij
808c513e 1cfe6f8c

+3 -5
+3 -5
drivers/gpio/gpio-vt8500.c
··· 309 309 return -ENODEV; 310 310 } 311 311 312 - gpio_base = devm_request_and_ioremap(&pdev->dev, res); 313 - if (!gpio_base) { 314 - dev_err(&pdev->dev, "Unable to map GPIO registers\n"); 315 - return -ENOMEM; 316 - } 312 + gpio_base = devm_ioremap_resource(&pdev->dev, res); 313 + if (IS_ERR(gpio_base)) 314 + return PTR_ERR(gpio_base); 317 315 318 316 ret = vt8500_add_chips(pdev, gpio_base, of_id->data); 319 317