gpio: dwapb_gpio: fix broken dev->node

commit 1b898ffc04 ("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 1b898ffc04 ("gpio: dwapb_gpio: convert to livetree")
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
This commit is contained in:
Simon Goldschmidt 2019-05-21 22:03:12 +02:00 committed by Marek Vasut
parent 40920bdecc
commit 34b1a510e8

View File

@ -185,12 +185,11 @@ static int gpio_dwapb_bind(struct udevice *dev)
plat->name = ofnode_get_name(node);
}
ret = device_bind(dev, dev->driver, plat->name,
plat, -1, &subdev);
ret = device_bind_ofnode(dev, dev->driver, plat->name,
plat, node, &subdev);
if (ret)
return ret;
dev->node = node;
bank++;
}