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>
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
index 377fed4..042996e 100644
--- a/drivers/gpio/s5p_gpio.c
+++ b/drivers/gpio/s5p_gpio.c
@@ -317,7 +317,7 @@
 		return 0;
 
 	base = (struct s5p_gpio_bank *)dev_get_addr(parent);
-	for (node = fdt_first_subnode(blob, parent->of_offset), bank = base;
+	for (node = fdt_first_subnode(blob, dev_of_offset(parent)), bank = base;
 	     node > 0;
 	     node = fdt_next_subnode(blob, node), bank++) {
 		struct exynos_gpio_platdata *plat;
@@ -337,7 +337,7 @@
 		if (ret)
 			return ret;
 
-		dev->of_offset = node;
+		dev_set_of_offset(dev, node);
 
 		reg = dev_get_addr(dev);
 		if (reg != FDT_ADDR_T_NONE)