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/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
index b077639..80f0dfa 100644
--- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c
+++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c
@@ -28,7 +28,7 @@
 int mvebu_pinctrl_set_state(struct udevice *dev, struct udevice *config)
 {
 	const void *blob = gd->fdt_blob;
-	int node = config->of_offset;
+	int node = dev_of_offset(config);
 	struct mvebu_pinctrl_priv *priv;
 	u32 pin_arr[MVEBU_MAX_PINS_PER_BANK];
 	u32 function;
@@ -82,7 +82,7 @@
 				       struct udevice *config)
 {
 	const void *blob = gd->fdt_blob;
-	int node = config->of_offset;
+	int node = dev_of_offset(config);
 	struct mvebu_pinctrl_priv *priv;
 	u32 func_arr[MVEBU_MAX_PINS_PER_BANK];
 	int pin, err;
@@ -128,7 +128,7 @@
 int mvebu_pinctl_probe(struct udevice *dev)
 {
 	const void *blob = gd->fdt_blob;
-	int node = dev->of_offset;
+	int node = dev_of_offset(dev);
 	struct mvebu_pinctrl_priv *priv;
 
 	priv = dev_get_priv(dev);