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>
This commit is contained in:
parent
603607e70e
commit
4e6864f856
|
@ -228,7 +228,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
|
||||||
struct mlxbf2_gpio_context *gs;
|
struct mlxbf2_gpio_context *gs;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct gpio_chip *gc;
|
struct gpio_chip *gc;
|
||||||
struct resource *res;
|
|
||||||
unsigned int npins;
|
unsigned int npins;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -237,13 +236,9 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* YU GPIO block address */
|
/* YU GPIO block address */
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
gs->gpio_io = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (!res)
|
if (IS_ERR(gs->gpio_io))
|
||||||
return -ENODEV;
|
return PTR_ERR(gs->gpio_io);
|
||||||
|
|
||||||
gs->gpio_io = devm_ioremap(dev, res->start, resource_size(res));
|
|
||||||
if (!gs->gpio_io)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
ret = mlxbf2_gpio_get_lock_res(pdev);
|
ret = mlxbf2_gpio_get_lock_res(pdev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
Loading…
Reference in New Issue