diff mbox series

[v1,1/1] gpio: Remove unused local OF node pointers

Message ID 20211220132439.1194-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/1] gpio: Remove unused local OF node pointers | expand

Commit Message

Andy Shevchenko Dec. 20, 2021, 1:24 p.m. UTC
After the commit 448cf90513d9 ("gpio: Get rid of duplicate of_node
assignment in the drivers") the OF node local pointers become unused.
Remove them for good and make compiler happy about.

Fixes: 448cf90513d9 ("gpio: Get rid of duplicate of_node assignment in the drivers")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-brcmstb.c | 2 +-
 drivers/gpio/gpio-gw-pld.c  | 1 -
 drivers/gpio/gpio-mt7621.c  | 5 ++---
 drivers/gpio/gpio-rda.c     | 1 -
 4 files changed, 3 insertions(+), 6 deletions(-)

Comments

Bartosz Golaszewski Dec. 20, 2021, 2:53 p.m. UTC | #1
On Mon, Dec 20, 2021 at 2:24 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> After the commit 448cf90513d9 ("gpio: Get rid of duplicate of_node
> assignment in the drivers") the OF node local pointers become unused.
> Remove them for good and make compiler happy about.
>
> Fixes: 448cf90513d9 ("gpio: Get rid of duplicate of_node assignment in the drivers")
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-brcmstb.c | 2 +-
>  drivers/gpio/gpio-gw-pld.c  | 1 -
>  drivers/gpio/gpio-mt7621.c  | 5 ++---
>  drivers/gpio/gpio-rda.c     | 1 -
>  4 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
> index 176c264bb959..74ef89248867 100644
> --- a/drivers/gpio/gpio-brcmstb.c
> +++ b/drivers/gpio/gpio-brcmstb.c
> @@ -704,7 +704,7 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
>                 }
>
>                 gc->owner = THIS_MODULE;
> -               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
> +               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);

This is unrelated though. Can you make it a separate patch?

Bart

>                 if (!gc->label) {
>                         err = -ENOMEM;
>                         goto fail;
> diff --git a/drivers/gpio/gpio-gw-pld.c b/drivers/gpio/gpio-gw-pld.c
> index 77a3fbd46111..2109803ffb38 100644
> --- a/drivers/gpio/gpio-gw-pld.c
> +++ b/drivers/gpio/gpio-gw-pld.c
> @@ -71,7 +71,6 @@ static int gw_pld_probe(struct i2c_client *client,
>                         const struct i2c_device_id *id)
>  {
>         struct device *dev = &client->dev;
> -       struct device_node *np = dev->of_node;
>         struct gw_pld *gw;
>         int ret;
>
> diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
> index 52b49e7a0a80..ccaad1cb3c2e 100644
> --- a/drivers/gpio/gpio-mt7621.c
> +++ b/drivers/gpio/gpio-mt7621.c
> @@ -205,8 +205,7 @@ mediatek_gpio_xlate(struct gpio_chip *chip,
>  }
>
>  static int
> -mediatek_gpio_bank_probe(struct device *dev,
> -                        struct device_node *node, int bank)
> +mediatek_gpio_bank_probe(struct device *dev, int bank)
>  {
>         struct mtk *mtk = dev_get_drvdata(dev);
>         struct mtk_gc *rg;
> @@ -310,7 +309,7 @@ mediatek_gpio_probe(struct platform_device *pdev)
>         platform_set_drvdata(pdev, mtk);
>
>         for (i = 0; i < MTK_BANK_CNT; i++) {
> -               ret = mediatek_gpio_bank_probe(dev, np, i);
> +               ret = mediatek_gpio_bank_probe(dev, i);
>                 if (ret)
>                         return ret;
>         }
> diff --git a/drivers/gpio/gpio-rda.c b/drivers/gpio/gpio-rda.c
> index 0d03f525dcd3..62ba18b3a602 100644
> --- a/drivers/gpio/gpio-rda.c
> +++ b/drivers/gpio/gpio-rda.c
> @@ -197,7 +197,6 @@ static void rda_gpio_irq_handler(struct irq_desc *desc)
>
>  static int rda_gpio_probe(struct platform_device *pdev)
>  {
> -       struct device_node *np = pdev->dev.of_node;
>         struct device *dev = &pdev->dev;
>         struct gpio_irq_chip *girq;
>         struct rda_gpio *rda_gpio;
> --
> 2.34.1
>
Andy Shevchenko Dec. 20, 2021, 3:09 p.m. UTC | #2
On Mon, Dec 20, 2021 at 5:09 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> On Mon, Dec 20, 2021 at 2:24 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > After the commit 448cf90513d9 ("gpio: Get rid of duplicate of_node
> > assignment in the drivers") the OF node local pointers become unused.
> > Remove them for good and make compiler happy about.
> >
> > Fixes: 448cf90513d9 ("gpio: Get rid of duplicate of_node assignment in the drivers")
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

...

> > -               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
> > +               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
>
> This is unrelated though. Can you make it a separate patch?

It actually makes use of the local np IIRC.
It's related, no?
Bartosz Golaszewski Dec. 21, 2021, 7:13 p.m. UTC | #3
On Mon, Dec 20, 2021 at 4:11 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Mon, Dec 20, 2021 at 5:09 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> >
> > On Mon, Dec 20, 2021 at 2:24 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > After the commit 448cf90513d9 ("gpio: Get rid of duplicate of_node
> > > assignment in the drivers") the OF node local pointers become unused.
> > > Remove them for good and make compiler happy about.
> > >
> > > Fixes: 448cf90513d9 ("gpio: Get rid of duplicate of_node assignment in the drivers")
> > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> ...
>
> > > -               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
> > > +               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
> >
> > This is unrelated though. Can you make it a separate patch?
>
> It actually makes use of the local np IIRC.
> It's related, no?

No, the np pointer is already used elsewhere. You just replace the
dev->of_node here with np. Rightfully so, but it's not part of this
commit logically.

Bart
Andy Shevchenko Dec. 21, 2021, 8:21 p.m. UTC | #4
On Tue, Dec 21, 2021 at 9:13 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> On Mon, Dec 20, 2021 at 4:11 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Mon, Dec 20, 2021 at 5:09 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > On Mon, Dec 20, 2021 at 2:24 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:

...

> > > > -               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
> > > > +               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
> > >
> > > This is unrelated though. Can you make it a separate patch?
> >
> > It actually makes use of the local np IIRC.
> > It's related, no?
>
> No, the np pointer is already used elsewhere. You just replace the
> dev->of_node here with np. Rightfully so, but it's not part of this
> commit logically.

I see. Probably I missed that somehow.
Nevertheless, do you want a new version or can you just revert that
particular change?
Bartosz Golaszewski Dec. 22, 2021, 9:06 a.m. UTC | #5
On Tue, Dec 21, 2021 at 9:21 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Dec 21, 2021 at 9:13 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > On Mon, Dec 20, 2021 at 4:11 PM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > > On Mon, Dec 20, 2021 at 5:09 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > > On Mon, Dec 20, 2021 at 2:24 PM Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com> wrote:
>
> ...
>
> > > > > -               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
> > > > > +               gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
> > > >
> > > > This is unrelated though. Can you make it a separate patch?
> > >
> > > It actually makes use of the local np IIRC.
> > > It's related, no?
> >
> > No, the np pointer is already used elsewhere. You just replace the
> > dev->of_node here with np. Rightfully so, but it's not part of this
> > commit logically.
>
> I see. Probably I missed that somehow.
> Nevertheless, do you want a new version or can you just revert that
> particular change?
>
> --
> With Best Regards,
> Andy Shevchenko

I removed it and queued the rest.

Bart
Andy Shevchenko Dec. 22, 2021, 11 a.m. UTC | #6
On Wed, Dec 22, 2021 at 10:06:53AM +0100, Bartosz Golaszewski wrote:
> On Tue, Dec 21, 2021 at 9:21 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Tue, Dec 21, 2021 at 9:13 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

...

> > I see. Probably I missed that somehow.
> > Nevertheless, do you want a new version or can you just revert that
> > particular change?
> 
> I removed it and queued the rest.

Thank you!
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 176c264bb959..74ef89248867 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -704,7 +704,7 @@  static int brcmstb_gpio_probe(struct platform_device *pdev)
 		}
 
 		gc->owner = THIS_MODULE;
-		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
+		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", np);
 		if (!gc->label) {
 			err = -ENOMEM;
 			goto fail;
diff --git a/drivers/gpio/gpio-gw-pld.c b/drivers/gpio/gpio-gw-pld.c
index 77a3fbd46111..2109803ffb38 100644
--- a/drivers/gpio/gpio-gw-pld.c
+++ b/drivers/gpio/gpio-gw-pld.c
@@ -71,7 +71,6 @@  static int gw_pld_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
 	struct device *dev = &client->dev;
-	struct device_node *np = dev->of_node;
 	struct gw_pld *gw;
 	int ret;
 
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index 52b49e7a0a80..ccaad1cb3c2e 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -205,8 +205,7 @@  mediatek_gpio_xlate(struct gpio_chip *chip,
 }
 
 static int
-mediatek_gpio_bank_probe(struct device *dev,
-			 struct device_node *node, int bank)
+mediatek_gpio_bank_probe(struct device *dev, int bank)
 {
 	struct mtk *mtk = dev_get_drvdata(dev);
 	struct mtk_gc *rg;
@@ -310,7 +309,7 @@  mediatek_gpio_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, mtk);
 
 	for (i = 0; i < MTK_BANK_CNT; i++) {
-		ret = mediatek_gpio_bank_probe(dev, np, i);
+		ret = mediatek_gpio_bank_probe(dev, i);
 		if (ret)
 			return ret;
 	}
diff --git a/drivers/gpio/gpio-rda.c b/drivers/gpio/gpio-rda.c
index 0d03f525dcd3..62ba18b3a602 100644
--- a/drivers/gpio/gpio-rda.c
+++ b/drivers/gpio/gpio-rda.c
@@ -197,7 +197,6 @@  static void rda_gpio_irq_handler(struct irq_desc *desc)
 
 static int rda_gpio_probe(struct platform_device *pdev)
 {
-	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 	struct gpio_irq_chip *girq;
 	struct rda_gpio *rda_gpio;