drivers: gpio: octeon: use devm_platform_ioremap_resource()
diff mbox series

Message ID 1552333701-22712-1-git-send-email-info@metux.net
State New
Headers show
Series
  • drivers: gpio: octeon: use devm_platform_ioremap_resource()
Related show

Commit Message

Enrico Weigelt, metux IT consult March 11, 2019, 7:48 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-octeon.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Bartosz Golaszewski March 12, 2019, 1:45 p.m. UTC | #1
pon., 11 mar 2019 o 20:48 Enrico Weigelt, metux IT consult
<info@metux.net> napisaƂ(a):
>
> 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-octeon.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
> index 1b19c88..afb0e8a 100644
> --- a/drivers/gpio/gpio-octeon.c
> +++ b/drivers/gpio/gpio-octeon.c
> @@ -82,7 +82,6 @@ static int octeon_gpio_probe(struct platform_device *pdev)
>  {
>         struct octeon_gpio *gpio;
>         struct gpio_chip *chip;
> -       struct resource *res_mem;
>         void __iomem *reg_base;
>         int err = 0;
>
> @@ -91,8 +90,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
>                 return -ENOMEM;
>         chip = &gpio->chip;
>
> -       res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       reg_base = devm_ioremap_resource(&pdev->dev, res_mem);
> +       reg_base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(reg_base))
>                 return PTR_ERR(reg_base);
>
> --
> 1.9.1
>

Can you make this a part of the bigger series and resend together with
subject line fixes?

Also: maybe consider adding a coccinelle script for that. When I added
that function I noticed there are 1200+ instances in the kernel that
need fixing. I think we'll be better off automating it.

Bart
Enrico Weigelt, metux IT consult March 12, 2019, 3:11 p.m. UTC | #2
On 12.03.19 14:45, Bartosz Golaszewski wrote:

> Can you make this a part of the bigger series and resend together with
> subject line fixes?

tried to resend it as reply on the prev version. but somehow this
didn't seem to work as intented.

> Also: maybe consider adding a coccinelle script for that. When I added
> that function I noticed there are 1200+ instances in the kernel that
> need fixing. I think we'll be better off automating it.

haven't coped w/ this yet ... I'll first need to have a deeper look
at it. advices welcomed.


--mtx
Linus Walleij April 3, 2019, 3:30 a.m. UTC | #3
On Tue, Mar 12, 2019 at 2:48 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.

Yours,
Linus Walleij

Patch
diff mbox series

diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
index 1b19c88..afb0e8a 100644
--- a/drivers/gpio/gpio-octeon.c
+++ b/drivers/gpio/gpio-octeon.c
@@ -82,7 +82,6 @@  static int octeon_gpio_probe(struct platform_device *pdev)
 {
 	struct octeon_gpio *gpio;
 	struct gpio_chip *chip;
-	struct resource *res_mem;
 	void __iomem *reg_base;
 	int err = 0;
 
@@ -91,8 +90,7 @@  static int octeon_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	chip = &gpio->chip;
 
-	res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	reg_base = devm_ioremap_resource(&pdev->dev, res_mem);
+	reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(reg_base))
 		return PTR_ERR(reg_base);