diff mbox series

[v3,1/2] of: unittest: Switch to use fwnode instead of of_node

Message ID 20220629115010.10538-1-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series [v3,1/2] of: unittest: Switch to use fwnode instead of of_node | expand

Commit Message

Andy Shevchenko June 29, 2022, 11:50 a.m. UTC
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(-)

Comments

Bartosz Golaszewski June 29, 2022, 6:50 p.m. UTC | #1
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>
Rob Herring June 30, 2022, 4:27 p.m. UTC | #2
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
Andy Shevchenko June 30, 2022, 7:02 p.m. UTC | #3
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.
Rob Herring June 30, 2022, 9:34 p.m. UTC | #4
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
Andy Shevchenko June 30, 2022, 9:37 p.m. UTC | #5
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!
diff mbox series

Patch

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++;