All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node
@ 2022-06-29 11:50 Andy Shevchenko
  2022-06-29 11:50 ` [PATCH v3 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe() Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-06-29 11:50 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, devicetree, linux-kernel, linux-gpio
  Cc: Rob Herring, Frank Rowand, Linus Walleij, Bartosz Golaszewski,
	Andy Shevchenko

GPIO library now accepts fwnode as a firmware node, so
switch the module to use it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: no changes
 drivers/of/unittest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 7f6bba18c515..5a842dfc27e8 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -1602,7 +1602,7 @@ static int unittest_gpio_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, devptr);
 
-	devptr->chip.of_node = pdev->dev.of_node;
+	devptr->chip.fwnode = dev_fwnode(&pdev->dev);
 	devptr->chip.label = "of-unittest-gpio";
 	devptr->chip.base = -1; /* dynamic allocation */
 	devptr->chip.ngpio = 5;
@@ -1611,7 +1611,7 @@ static int unittest_gpio_probe(struct platform_device *pdev)
 	ret = gpiochip_add_data(&devptr->chip, NULL);
 
 	unittest(!ret,
-		 "gpiochip_add_data() for node @%pOF failed, ret = %d\n", devptr->chip.of_node, ret);
+		 "gpiochip_add_data() for node @%pfw failed, ret = %d\n", devptr->chip.fwnode, ret);
 
 	if (!ret)
 		unittest_gpio_probe_pass_count++;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe()
  2022-06-29 11:50 [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Andy Shevchenko
@ 2022-06-29 11:50 ` Andy Shevchenko
  2022-06-29 18:50 ` [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Bartosz Golaszewski
  2022-06-30 16:27 ` Rob Herring
  2 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-06-29 11:50 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, devicetree, linux-kernel, linux-gpio
  Cc: Rob Herring, Frank Rowand, Linus Walleij, Bartosz Golaszewski,
	Andy Shevchenko

On the ->remove() stage the callback uses physical device node instead of one
from GPIO chip and the variable name which is different to one used in
unittest_gpio_probe(). Make these consistent with unittest_gpio_probe().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: new patch
 drivers/of/unittest.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 5a842dfc27e8..eafa8ffefbd0 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -1620,20 +1620,19 @@ static int unittest_gpio_probe(struct platform_device *pdev)
 
 static int unittest_gpio_remove(struct platform_device *pdev)
 {
-	struct unittest_gpio_dev *gdev = platform_get_drvdata(pdev);
+	struct unittest_gpio_dev *devptr = platform_get_drvdata(pdev);
 	struct device *dev = &pdev->dev;
-	struct device_node *np = pdev->dev.of_node;
 
-	dev_dbg(dev, "%s for node @%pOF\n", __func__, np);
+	dev_dbg(dev, "%s for node @%pfw\n", __func__, devptr->chip.fwnode);
 
-	if (!gdev)
+	if (!devptr)
 		return -EINVAL;
 
-	if (gdev->chip.base != -1)
-		gpiochip_remove(&gdev->chip);
+	if (devptr->chip.base != -1)
+		gpiochip_remove(&devptr->chip);
 
 	platform_set_drvdata(pdev, NULL);
-	kfree(gdev);
+	kfree(devptr);
 
 	return 0;
 }
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node
  2022-06-29 11:50 [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Andy Shevchenko
  2022-06-29 11:50 ` [PATCH v3 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe() Andy Shevchenko
@ 2022-06-29 18:50 ` Bartosz Golaszewski
  2022-06-30 16:27 ` Rob Herring
  2 siblings, 0 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2022-06-29 18:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rob Herring, Frank Rowand, devicetree, Linux Kernel Mailing List,
	open list:GPIO SUBSYSTEM, Rob Herring, Frank Rowand,
	Linus Walleij

On Wed, Jun 29, 2022 at 1:50 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library now accepts fwnode as a firmware node, so
> switch the module to use it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v3: no changes
>  drivers/of/unittest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 7f6bba18c515..5a842dfc27e8 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -1602,7 +1602,7 @@ static int unittest_gpio_probe(struct platform_device *pdev)
>
>         platform_set_drvdata(pdev, devptr);
>
> -       devptr->chip.of_node = pdev->dev.of_node;
> +       devptr->chip.fwnode = dev_fwnode(&pdev->dev);
>         devptr->chip.label = "of-unittest-gpio";
>         devptr->chip.base = -1; /* dynamic allocation */
>         devptr->chip.ngpio = 5;
> @@ -1611,7 +1611,7 @@ static int unittest_gpio_probe(struct platform_device *pdev)
>         ret = gpiochip_add_data(&devptr->chip, NULL);
>
>         unittest(!ret,
> -                "gpiochip_add_data() for node @%pOF failed, ret = %d\n", devptr->chip.of_node, ret);
> +                "gpiochip_add_data() for node @%pfw failed, ret = %d\n", devptr->chip.fwnode, ret);
>
>         if (!ret)
>                 unittest_gpio_probe_pass_count++;
> --
> 2.35.1
>

Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node
  2022-06-29 11:50 [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Andy Shevchenko
  2022-06-29 11:50 ` [PATCH v3 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe() Andy Shevchenko
  2022-06-29 18:50 ` [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Bartosz Golaszewski
@ 2022-06-30 16:27 ` Rob Herring
  2022-06-30 19:02   ` Andy Shevchenko
  2 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2022-06-30 16:27 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Frank Rowand, devicetree, linux-kernel, linux-gpio, Frank Rowand,
	Linus Walleij, Bartosz Golaszewski

On Wed, Jun 29, 2022 at 02:50:09PM +0300, Andy Shevchenko wrote:
> GPIO library now accepts fwnode as a firmware node, so
> switch the module to use it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v3: no changes
>  drivers/of/unittest.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
> index 7f6bba18c515..5a842dfc27e8 100644
> --- a/drivers/of/unittest.c
> +++ b/drivers/of/unittest.c
> @@ -1602,7 +1602,7 @@ static int unittest_gpio_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, devptr);
>  
> -	devptr->chip.of_node = pdev->dev.of_node;
> +	devptr->chip.fwnode = dev_fwnode(&pdev->dev);

Perhaps I want the DT test code to test using the of_node pointer. We do 
want that to work, right?

I'm really not a fan of fwnode'ifying things that are DT only. It's 
really pointless churn.

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node
  2022-06-30 16:27 ` Rob Herring
@ 2022-06-30 19:02   ` Andy Shevchenko
  2022-06-30 21:34     ` Rob Herring
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2022-06-30 19:02 UTC (permalink / raw)
  To: Rob Herring
  Cc: Andy Shevchenko, Frank Rowand, devicetree,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Frank Rowand, Linus Walleij, Bartosz Golaszewski

On Thu, Jun 30, 2022 at 6:29 PM Rob Herring <robh@kernel.org> wrote:
> On Wed, Jun 29, 2022 at 02:50:09PM +0300, Andy Shevchenko wrote:
> > GPIO library now accepts fwnode as a firmware node, so
> > switch the module to use it.

...

> > -     devptr->chip.of_node = pdev->dev.of_node;
> > +     devptr->chip.fwnode = dev_fwnode(&pdev->dev);
>
> Perhaps I want the DT test code to test using the of_node pointer. We do
> want that to work, right?

Nope. We want to get rid of of_node in GPIO.

> I'm really not a fan of fwnode'ifying things that are DT only. It's
> really pointless churn.

Other way around, keeping an of_node for just 3 drivers (and counting
down) + one test case is pointless churn.

But I got that commit message that is unclear about the intentions
behind. I will update that if you agree on the rest.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node
  2022-06-30 19:02   ` Andy Shevchenko
@ 2022-06-30 21:34     ` Rob Herring
  2022-06-30 21:37       ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2022-06-30 21:34 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Andy Shevchenko, Frank Rowand, devicetree,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Frank Rowand, Linus Walleij, Bartosz Golaszewski

On Thu, Jun 30, 2022 at 1:03 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Thu, Jun 30, 2022 at 6:29 PM Rob Herring <robh@kernel.org> wrote:
> > On Wed, Jun 29, 2022 at 02:50:09PM +0300, Andy Shevchenko wrote:
> > > GPIO library now accepts fwnode as a firmware node, so
> > > switch the module to use it.
>
> ...
>
> > > -     devptr->chip.of_node = pdev->dev.of_node;
> > > +     devptr->chip.fwnode = dev_fwnode(&pdev->dev);
> >
> > Perhaps I want the DT test code to test using the of_node pointer. We do
> > want that to work, right?
>
> Nope. We want to get rid of of_node in GPIO.

I would think there's old PPC users preventing that, but if not, good job.

> > I'm really not a fan of fwnode'ifying things that are DT only. It's
> > really pointless churn.
>
> Other way around, keeping an of_node for just 3 drivers (and counting
> down) + one test case is pointless churn.
>
> But I got that commit message that is unclear about the intentions
> behind. I will update that if you agree on the rest.

If it is going away, then what choice do I have. :)

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node
  2022-06-30 21:34     ` Rob Herring
@ 2022-06-30 21:37       ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-06-30 21:37 UTC (permalink / raw)
  To: Rob Herring
  Cc: Andy Shevchenko, Frank Rowand, devicetree,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Frank Rowand, Linus Walleij, Bartosz Golaszewski

On Thu, Jun 30, 2022 at 11:34 PM Rob Herring <robh@kernel.org> wrote:
> On Thu, Jun 30, 2022 at 1:03 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > On Thu, Jun 30, 2022 at 6:29 PM Rob Herring <robh@kernel.org> wrote:
> > > On Wed, Jun 29, 2022 at 02:50:09PM +0300, Andy Shevchenko wrote:
> > > > GPIO library now accepts fwnode as a firmware node, so
> > > > switch the module to use it.

...

> > > > -     devptr->chip.of_node = pdev->dev.of_node;
> > > > +     devptr->chip.fwnode = dev_fwnode(&pdev->dev);
> > >
> > > Perhaps I want the DT test code to test using the of_node pointer. We do
> > > want that to work, right?
> >
> > Nope. We want to get rid of of_node in GPIO.
>
> I would think there's old PPC users preventing that, but if not, good job.

Recently applied by respective maintainer, so no more PPC GPIO using OF node.

> > > I'm really not a fan of fwnode'ifying things that are DT only. It's
> > > really pointless churn.
> >
> > Other way around, keeping an of_node for just 3 drivers (and counting
> > down) + one test case is pointless churn.
> >
> > But I got that commit message that is unclear about the intentions
> > behind. I will update that if you agree on the rest.
>
> If it is going away, then what choice do I have. :)

Yep, that is the idea.

I interpret this as "go ahead with a better commit message and I will Ack it"!

Thanks, Rob, for your review!

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-30 21:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29 11:50 [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Andy Shevchenko
2022-06-29 11:50 ` [PATCH v3 2/2] of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe() Andy Shevchenko
2022-06-29 18:50 ` [PATCH v3 1/2] of: unittest: Switch to use fwnode instead of of_node Bartosz Golaszewski
2022-06-30 16:27 ` Rob Herring
2022-06-30 19:02   ` Andy Shevchenko
2022-06-30 21:34     ` Rob Herring
2022-06-30 21:37       ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.