diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-06-07 18:46:01 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2017-07-11 12:13:43 +0200 |
commit | 7ad326a905dac36939f9ea725835f809e1b7f432 (patch) | |
tree | c257aef8ef23c75090c6c47427dac89de67c45ca /drivers/net/gmac_rockchip.c | |
parent | fd1bf8df2507fb488febe4b5e4498adbef0fb43e (diff) | |
download | u-boot-7ad326a905dac36939f9ea725835f809e1b7f432.tar.gz |
rockchip: net: dm: convert fdt_get to dev_read
With the new dev_read functions available, we can convert the rockchip
architecture-specific drivers and common drivers used by these devices
over to the dev_read family of calls.
This covers the Gigabit Ethernet MAC (i.e. common designware driver and
rockchip-specific wrapper).
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/net/gmac_rockchip.c')
-rw-r--r-- | drivers/net/gmac_rockchip.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/gmac_rockchip.c b/drivers/net/gmac_rockchip.c index 5e2ca76302..c9f9e839ba 100644 --- a/drivers/net/gmac_rockchip.c +++ b/drivers/net/gmac_rockchip.c @@ -43,18 +43,16 @@ struct rk_gmac_ops { static int gmac_rockchip_ofdata_to_platdata(struct udevice *dev) { struct gmac_rockchip_platdata *pdata = dev_get_platdata(dev); - const void *blob = gd->fdt_blob; - int node = dev_of_offset(dev); /* Check the new naming-style first... */ - pdata->tx_delay = fdtdec_get_int(blob, node, "tx_delay", -ENOENT); - pdata->rx_delay = fdtdec_get_int(blob, node, "rx_delay", -ENOENT); + pdata->tx_delay = dev_read_u32_default(dev, "tx_delay", -ENOENT); + pdata->rx_delay = dev_read_u32_default(dev, "rx_delay", -ENOENT); /* ... and fall back to the old naming style or default, if necessary */ if (pdata->tx_delay == -ENOENT) - pdata->tx_delay = fdtdec_get_int(blob, node, "tx-delay", 0x30); + pdata->tx_delay = dev_read_u32_default(dev, "tx-delay", 0x30); if (pdata->rx_delay == -ENOENT) - pdata->rx_delay = fdtdec_get_int(blob, node, "rx-delay", 0x10); + pdata->rx_delay = dev_read_u32_default(dev, "rx-delay", 0x10); return designware_eth_ofdata_to_platdata(dev); } |