gpio: dwapb_gpio: fix broken dev->node
PATCH 1/1 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.
---
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(-)
drivers/gpio/dwapb_gpio.c +1 -1
@@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev)if (ret)return ret; - dev->node = node; + subdev->node = node; bank++; }
Signature · 1 line
2.20.1
Marek Vasut
AppliedPATCH 1/1 gpio: dwapb_gpio: fix broken dev->node
Quoted 25 lines · Simon Goldschmidt
commit
1b898ffc040b("gpio:dwapb_gpio: convert to livetree") introduced a bug in thatdev->nodeof the gpio chip was accidentally set to theof_nodeof its bank subnode.What it meant to do was assign
subdev->node, notdev->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 <[email protected]>---
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(-)drivers/gpio/dwapb_gpio.c +0
-0
drivers/gpio/dwapb_gpio.c static int gpio_dwapb_bind(struct udevice *dev) · line 196
Quoted 8 lines
drivers/gpio/dwapb_gpio.c +1
-1@@ -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
Signature · 2 lines
Best regards, Marek Vasut
PATCH 1/1 gpio: dwapb_gpio: fix broken dev->node
Quoted 29 lines · Marek Vasut
Quoted 27 lines · Simon Goldschmidt
commit
1b898ffc040b("gpio:dwapb_gpio: convert to livetree") introduced a bug in thatdev->nodeof the gpio chip was accidentally set to theof_nodeof its bank subnode.What it meant to do was assign
subdev->node, notdev->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 <[email protected]>---
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(-)drivers/gpio/dwapb_gpio.c +0
-0@@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev)if (ret)return ret;
Quoted 7 lines
drivers/gpio/dwapb_gpio.c static int gpio_dwapb_bind(struct udevice *dev) · line 196
Quoted 6 lines
drivers/gpio/dwapb_gpio.c +1
-1- 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
PATCH 1/1 gpio: dwapb_gpio: fix broken dev->node
Quoted 38 lines · Simon Goldschmidt
Quoted 29 lines · Marek Vasut
Quoted 27 lines · Simon Goldschmidt
commit
1b898ffc040b("gpio:dwapb_gpio: convert to livetree") introduced a bug in thatdev->nodeof the gpio chip was accidentally set to theof_nodeof its bank subnode.What it meant to do was assign
subdev->node, notdev->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 <[email protected]>---
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(-)drivers/gpio/dwapb_gpio.c +0
-0@@ -190,7 +190,7 @@ static int gpio_dwapb_bind(struct udevice *dev)if (ret)return ret;Quoted 7 lines
drivers/gpio/dwapb_gpio.c static int gpio_dwapb_bind(struct udevice *dev) · line 196
Quoted 6 lines
drivers/gpio/dwapb_gpio.c +1
-1- dev->node = node; + subdev->node = node; bank++; }Applied, thanks
Quoted 6 lines
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 accessingsubdev->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.
Signature · 2 lines
Best regards, Marek Vasut