diff options
author | Simon Glass <sjg@chromium.org> | 2017-01-17 16:52:55 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-02-08 06:12:14 -0700 |
commit | e160f7d430f163bc42757aff3bf2bcac0a459f02 (patch) | |
tree | ce006f94b4a52f6fff567eacd86922c3be6df706 /drivers/gpio/dwapb_gpio.c | |
parent | 8aa41363ebf46b9ff63b311bd2aa793c67a49def (diff) | |
download | u-boot-imx-e160f7d430f163bc42757aff3bf2bcac0a459f02.zip u-boot-imx-e160f7d430f163bc42757aff3bf2bcac0a459f02.tar.gz u-boot-imx-e160f7d430f163bc42757aff3bf2bcac0a459f02.tar.bz2 |
dm: core: Replace of_offset with accessor
At present devices use a simple integer offset to record the device tree
node associated with the device. In preparation for supporting a live
device tree, which uses a node pointer instead, refactor existing code to
access this field through an inline function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/gpio/dwapb_gpio.c')
-rw-r--r-- | drivers/gpio/dwapb_gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/dwapb_gpio.c b/drivers/gpio/dwapb_gpio.c index 85e0a86..7d1904c 100644 --- a/drivers/gpio/dwapb_gpio.c +++ b/drivers/gpio/dwapb_gpio.c @@ -112,13 +112,13 @@ static int gpio_dwapb_bind(struct udevice *dev) if (plat) return 0; - base = fdtdec_get_addr(blob, dev->of_offset, "reg"); + base = fdtdec_get_addr(blob, dev_of_offset(dev), "reg"); if (base == FDT_ADDR_T_NONE) { debug("Can't get the GPIO register base address\n"); return -ENXIO; } - for (node = fdt_first_subnode(blob, dev->of_offset); + for (node = fdt_first_subnode(blob, dev_of_offset(dev)); node > 0; node = fdt_next_subnode(blob, node)) { if (!fdtdec_get_bool(blob, node, "gpio-controller")) @@ -142,7 +142,7 @@ static int gpio_dwapb_bind(struct udevice *dev) if (ret) goto err; - subdev->of_offset = node; + dev_set_of_offset(subdev, node); bank++; } |