[U-Boot] [PATCH] gpio: dwapb_gpio: fix broken dev->node

commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") introduced a bug in that dev->node of the gpio chip was accidentally set to the of_node of its bank subnode.
What it meant to do was assign subdev->node, not dev->node.
While this doesn't affect too many use cases, iterating over the gpio chip's properties doesn't work any more after that, so fix this.
Fixes: commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com ---
This fixes a commit that is only 12 days old, so it's a fix for v2019.07
--- drivers/gpio/dwapb_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 04a2381acd..d6887a396a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) return ret;
- dev->node = node; + subdev->node = node; bank++; }

On 5/21/19 10:03 PM, Simon Goldschmidt wrote:
commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") introduced a bug in that dev->node of the gpio chip was accidentally set to the of_node of its bank subnode.
What it meant to do was assign subdev->node, not dev->node.
While this doesn't affect too many use cases, iterating over the gpio chip's properties doesn't work any more after that, so fix this.
Fixes: commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
This fixes a commit that is only 12 days old, so it's a fix for v2019.07
drivers/gpio/dwapb_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 04a2381acd..d6887a396a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) return ret;
dev->node = node;
bank++; }subdev->node = node;
Applied, thanks

On Tue, May 21, 2019 at 10:22 PM Marek Vasut marex@denx.de wrote:
On 5/21/19 10:03 PM, Simon Goldschmidt wrote:
commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") introduced a bug in that dev->node of the gpio chip was accidentally set to the of_node of its bank subnode.
What it meant to do was assign subdev->node, not dev->node.
While this doesn't affect too many use cases, iterating over the gpio chip's properties doesn't work any more after that, so fix this.
Fixes: commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
This fixes a commit that is only 12 days old, so it's a fix for v2019.07
drivers/gpio/dwapb_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 04a2381acd..d6887a396a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) return ret;
dev->node = node;
subdev->node = node; bank++; }
Applied, thanks
Looking around 'include/dm/device-internal.h', I just saw that a more appropriate fix would be to use 'device_bind_ofnode()' instead of calling 'device_bind()' and assigning the node ourself by accessing subdev->node.
Do you want me to send a follow-up or a v2 of this, given that you already applied this v1?
Regards, Simon

On 5/22/19 10:46 AM, Simon Goldschmidt wrote:
On Tue, May 21, 2019 at 10:22 PM Marek Vasut marex@denx.de wrote:
On 5/21/19 10:03 PM, Simon Goldschmidt wrote:
commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") introduced a bug in that dev->node of the gpio chip was accidentally set to the of_node of its bank subnode.
What it meant to do was assign subdev->node, not dev->node.
While this doesn't affect too many use cases, iterating over the gpio chip's properties doesn't work any more after that, so fix this.
Fixes: commit 1b898ffc040b ("gpio: dwapb_gpio: convert to livetree") Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
This fixes a commit that is only 12 days old, so it's a fix for v2019.07
drivers/gpio/dwapb_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 04a2381acd..d6887a396a 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) return ret;
dev->node = node;
subdev->node = node; bank++; }
Applied, thanks
Looking around 'include/dm/device-internal.h', I just saw that a more appropriate fix would be to use 'device_bind_ofnode()' instead of calling 'device_bind()' and assigning the node ourself by accessing subdev->node.
Do you want me to send a follow-up or a v2 of this, given that you already applied this v1?
Send a follow up patch, I will squash them.
participants (2)
-
Marek Vasut
-
Simon Goldschmidt