diff options
author | Simon Glass <sjg@chromium.org> | 2017-01-17 16:52:55 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-02-08 06:12:14 -0700 |
commit | e160f7d430f163bc42757aff3bf2bcac0a459f02 (patch) | |
tree | ce006f94b4a52f6fff567eacd86922c3be6df706 /drivers/net/keystone_net.c | |
parent | 8aa41363ebf46b9ff63b311bd2aa793c67a49def (diff) | |
download | u-boot-imx-e160f7d430f163bc42757aff3bf2bcac0a459f02.zip u-boot-imx-e160f7d430f163bc42757aff3bf2bcac0a459f02.tar.gz u-boot-imx-e160f7d430f163bc42757aff3bf2bcac0a459f02.tar.bz2 |
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>
Diffstat (limited to 'drivers/net/keystone_net.c')
-rw-r--r-- | drivers/net/keystone_net.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c index a5120e0..1b781f4 100644 --- a/drivers/net/keystone_net.c +++ b/drivers/net/keystone_net.c @@ -1099,7 +1099,7 @@ static int ks2_sl_eth_ofdata_to_platdata(struct udevice *dev) struct ks2_eth_priv *priv = dev_get_priv(dev); struct eth_pdata *pdata = dev_get_platdata(dev); const void *fdt = gd->fdt_blob; - int slave = dev->of_offset; + int slave = dev_of_offset(dev); int interfaces; int gbe; int netcp_devices; @@ -1126,13 +1126,13 @@ static int ks2_eth_ofdata_to_platdata(struct udevice *dev) int netcp_devices; int gbe; - netcp_devices = fdt_subnode_offset(fdt, dev->of_offset, + netcp_devices = fdt_subnode_offset(fdt, dev_of_offset(dev), "netcp-devices"); gbe = fdt_subnode_offset(fdt, netcp_devices, "gbe"); ks2_eth_bind_slaves(dev, gbe, &gbe_0); - ks2_eth_parse_slave_interface(dev->of_offset, gbe_0, priv, pdata); + ks2_eth_parse_slave_interface(dev_of_offset(dev), gbe_0, priv, pdata); pdata->iobase = dev_get_addr(dev); |