diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-08-16 14:59:50 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2021-08-16 22:21:07 +0300 |
commit | 4e6864f8563df318f1aac92f23d06210a2b3d15f (patch) | |
tree | 4e8bb7adb977ff5b8c81108901a187ad8f3b3d17 /drivers/gpio | |
parent | 603607e70e3626e6ceb3ddec86e2a060c6cd6191 (diff) | |
download | linux-4e6864f8563df318f1aac92f23d06210a2b3d15f.tar.xz |
gpio: mlxbf2: Use devm_platform_ioremap_resource()
Simplify the platform_get_resource() and devm_ioremap_resource()
calls with devm_platform_ioremap_resource().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-mlxbf2.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index 8e6f780923a6..661d5a831ae9 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -228,7 +228,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev) struct mlxbf2_gpio_context *gs; struct device *dev = &pdev->dev; struct gpio_chip *gc; - struct resource *res; unsigned int npins; int ret; @@ -237,13 +236,9 @@ mlxbf2_gpio_probe(struct platform_device *pdev) return -ENOMEM; /* YU GPIO block address */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - - gs->gpio_io = devm_ioremap(dev, res->start, resource_size(res)); - if (!gs->gpio_io) - return -ENOMEM; + gs->gpio_io = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(gs->gpio_io)) + return PTR_ERR(gs->gpio_io); ret = mlxbf2_gpio_get_lock_res(pdev); if (ret) { |