[U-Boot] [PATCH 1/3] net: phy: ti: Modify to support livetree
Siva Durga Prasad Paladugu
siva.durga.paladugu at xilinx.com
Fri Jul 6 10:10:24 UTC 2018
This patch adds support for livetree by using
dev_.. calls instead of fdtdec_..
Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu at xilinx.com>
---
drivers/net/phy/ti.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/net/phy/ti.c b/drivers/net/phy/ti.c
index 8f3ed8a..945d9e9 100644
--- a/drivers/net/phy/ti.c
+++ b/drivers/net/phy/ti.c
@@ -173,24 +173,22 @@ static int dp83867_of_init(struct phy_device *phydev)
{
struct dp83867_private *dp83867 = phydev->priv;
struct udevice *dev = phydev->dev;
- int node = dev_of_offset(dev);
const void *fdt = gd->fdt_blob;
- if (fdtdec_get_bool(fdt, node, "ti,max-output-impedance"))
+ if (dev_read_bool(dev, "ti,max-output-impedance"))
dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX;
- else if (fdtdec_get_bool(fdt, node, "ti,min-output-impedance"))
+ else if (dev_read_bool(dev, "ti,min-output-impedance"))
dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN;
else
dp83867->io_impedance = -EINVAL;
- dp83867->rx_id_delay = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
- "ti,rx-internal-delay", -1);
+ dp83867->rx_id_delay = dev_read_u32_default(dev, "ti,rx-internal-delay",
+ -1);
- dp83867->tx_id_delay = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
- "ti,tx-internal-delay", -1);
+ dp83867->tx_id_delay = dev_read_u32_default(dev, "ti,tx-internal-delay",
+ -1);
- dp83867->fifo_depth = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
- "ti,fifo-depth", -1);
+ dp83867->fifo_depth = dev_read_u32_default(dev, "ti,fifo-depth", -1);
return 0;
}
--
2.7.4
More information about the U-Boot
mailing list