diff options
author | Simon Glass | 2017-05-17 17:18:09 -0600 |
---|---|---|
committer | Simon Glass | 2017-06-01 07:03:04 -0600 |
commit | da409ccc4ae62a0bf7111e2f4419fdbfd1ba3d89 (patch) | |
tree | 19067ef92401a002a53be1388fcd7842d3c52ecb /drivers/net/sun8i_emac.c | |
parent | a771a04f2eb34934a058a6c06319bd8bc5cb5fb8 (diff) |
dm: core: Replace of_offset with accessor (part 2)
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/sun8i_emac.c')
-rw-r--r-- | drivers/net/sun8i_emac.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index d895d09a76a..09bbb2cdb5c 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -820,7 +820,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev) parse_phy_pins(dev); #ifdef CONFIG_DM_GPIO - if (fdtdec_get_bool(gd->fdt_blob, dev->of_offset, + if (fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), "snps,reset-active-low")) reset_flags |= GPIOD_ACTIVE_LOW; @@ -828,7 +828,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev) &priv->reset_gpio, reset_flags); if (ret == 0) { - ret = fdtdec_get_int_array(gd->fdt_blob, dev->of_offset, + ret = fdtdec_get_int_array(gd->fdt_blob, dev_of_offset(dev), "snps,reset-delays-us", sun8i_pdata->reset_delays, 3); } else if (ret == -ENOENT) { |