From e160f7d430f163bc42757aff3bf2bcac0a459f02 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 17 Jan 2017 16:52:55 -0700 Subject: 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 --- drivers/gpio/dwapb_gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpio/dwapb_gpio.c') 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++; } -- cgit v1.1