diff mbox series

drivers: gpio: omap: use devm_platform_ioremap_resource()

Message ID 1552333805-23235-1-git-send-email-info@metux.net (mailing list archive)
State New, archived
Headers show
Series drivers: gpio: omap: use devm_platform_ioremap_resource() | expand

Commit Message

Enrico Weigelt, metux IT consult March 11, 2019, 7:50 p.m. UTC
Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/gpio/gpio-omap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Grygorii Strashko March 14, 2019, 10:43 a.m. UTC | #1
On 11.03.19 21:50, Enrico Weigelt, metux IT consult wrote:
> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ---
>  drivers/gpio/gpio-omap.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 7f33024..ce6e67a 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1289,7 +1289,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
>  	struct device_node *node = dev->of_node;
>  	const struct of_device_id *match;
>  	const struct omap_gpio_platform_data *pdata;
> -	struct resource *res;
>  	struct gpio_bank *bank;
>  	struct irq_chip *irqc;
>  	int ret;
> @@ -1375,8 +1374,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
>  	raw_spin_lock_init(&bank->wa_lock);
>  
>  	/* Static mapping, never released */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	bank->base = devm_ioremap_resource(dev, res);
> +	bank->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(bank->base)) {
>  		return PTR_ERR(bank->base);
>  	}
> 

Acked-by: Grygorii Strashko <grygorii.strashko@ti.com>
Linus Walleij April 3, 2019, 3:07 a.m. UTC | #2
On Tue, Mar 12, 2019 at 2:50 AM Enrico Weigelt, metux IT consult
<info@metux.net> wrote:

> Use the new helper that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
>
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Patch applied with Grygorii's ACK.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 7f33024..ce6e67a 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1289,7 +1289,6 @@  static int omap_gpio_probe(struct platform_device *pdev)
 	struct device_node *node = dev->of_node;
 	const struct of_device_id *match;
 	const struct omap_gpio_platform_data *pdata;
-	struct resource *res;
 	struct gpio_bank *bank;
 	struct irq_chip *irqc;
 	int ret;
@@ -1375,8 +1374,7 @@  static int omap_gpio_probe(struct platform_device *pdev)
 	raw_spin_lock_init(&bank->wa_lock);
 
 	/* Static mapping, never released */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	bank->base = devm_ioremap_resource(dev, res);
+	bank->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(bank->base)) {
 		return PTR_ERR(bank->base);
 	}