of: unittest: Switch to use fwnode instead of of_node
Subsystems (2)
PATCH v3 1/2 of: unittest: Switch to use fwnode instead of of_node
GPIO library now accepts fwnode as a firmware node, so switch the module to use it.
---
v3: no changes
drivers/of/unittest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/of/unittest.c +2 -2
@@ -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++;
Signature · 1 line
2.35.1
PATCH v3 2/2 of: unittest: make unittest_gpio_remove() consistent with unittest_gpio_probe()
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().
---
v3: new patch
drivers/of/unittest.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/of/unittest.c +6 -7
@@ -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 ; }
Signature · 1 line
2.35.1
Quoted 33 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the module to use it.
Signed-off-by Andy Shevchenko <[email protected]>---
v3: no changesdrivers/of/unittest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/of/unittest.c +2
-3@@ -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++; --
Quoted 2 lines
2.35.1
Rob Herring
maintainerQuoted 14 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the module to use it.
Signed-off-by Andy Shevchenko <[email protected]>---
v3: no changesdrivers/of/unittest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/of/unittest.c +0
-0
drivers/of/unittest.c static int unittest_gpio_probe(struct platform_device *pdev) · line 1605
Quoted 5 lines
drivers/of/unittest.c +1
-1@@ -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
Quoted 3 lines · Rob Herring
Quoted 2 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the module to use it.
...
Quoted 5 lines
drivers/of/unittest.c static int unittest_gpio_probe(struct platform_device *pdev) · line 1605
Quoted 2 lines
drivers/of/unittest.c +1
-1- 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_nodepointer. We do want that to work, right?
Nope. We want to get rid of of_node in GPIO.
Quoted 2 lines
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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Rob Herring
maintainerQuoted 8 lines · Andy Shevchenko
Quoted 3 lines · Rob Herring
Quoted 2 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the module to use it.
...
Quoted 7 lines
Quoted 5 lines
drivers/of/unittest.c static int unittest_gpio_probe(struct platform_device *pdev) · line 1605
Quoted 2 lines
drivers/of/unittest.c +1
-1- 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_nodepointer. We do want that to work, right?Nope. We want to get rid of
of_nodein GPIO.
I would think there's old PPC users preventing that, but if not, good job.
Quoted 8 lines
Quoted 2 lines
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_nodefor 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
Quoted 6 lines · Rob Herring
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Rob Herring
Quoted 2 lines · Andy Shevchenko
GPIO library now accepts fwnode as a firmware node, so switch the module to use it.
...
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
drivers/of/unittest.c static int unittest_gpio_probe(struct platform_device *pdev) · line 1605
Quoted 2 lines
drivers/of/unittest.c +1
-1- 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_nodepointer. We do want that to work, right?Nope. We want to get rid of
of_nodein 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.
Quoted 10 lines
Quoted 8 lines
Quoted 2 lines
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_nodefor 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!
Signature · 2 lines
With Best Regards, Andy Shevchenko