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/net/tsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/tsec.c') diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 7df4c63acf..f2ce4e2a8e 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -783,7 +783,7 @@ int tsec_probe(struct udevice *dev) pdata->iobase = (phys_addr_t)dev_get_addr(dev); priv->regs = (struct tsec *)pdata->iobase; - offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset, + offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev), "phy-handle"); if (offset > 0) { reg = fdtdec_get_int(gd->fdt_blob, offset, "reg", 0); @@ -802,7 +802,7 @@ int tsec_probe(struct udevice *dev) return -ENOENT; } - offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset, + offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev), "tbi-handle"); if (offset > 0) { reg = fdtdec_get_int(gd->fdt_blob, offset, "reg", @@ -812,7 +812,7 @@ int tsec_probe(struct udevice *dev) priv->tbiaddr = CONFIG_SYS_TBIPA_VALUE; } - phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, + phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-connection-type", NULL); if (phy_mode) pdata->phy_interface = phy_get_interface_by_name(phy_mode); -- cgit v1.2.3