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/macb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/macb.c') diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 01527f7..452fc3e 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -999,7 +999,8 @@ static int macb_eth_probe(struct udevice *dev) #ifdef CONFIG_DM_ETH const char *phy_mode; - phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL); + phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", + NULL); if (phy_mode) macb->phy_interface = phy_get_interface_by_name(phy_mode); if (macb->phy_interface == -1) { -- cgit v1.1