Message ID | 20200512095603.29126-2-david.wu@rock-chips.com |
---|---|
State | New |
Headers | show |
Series | Add dwc_eth_qos support for rockchip | expand |
Hi David On 5/12/20 11:56 AM, David Wu wrote: > It seems dev_ functions are more general than fdt_ functions. > > Signed-off-by: David Wu <david.wu at rock-chips.com> > --- > > Changes in v2: > - None > > drivers/net/dwc_eth_qos.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c > index f67c5f4570..66a02aa80b 100644 > --- a/drivers/net/dwc_eth_qos.c > +++ b/drivers/net/dwc_eth_qos.c > @@ -1889,8 +1889,7 @@ static phy_interface_t eqos_get_interface_stm32(struct udevice *dev) > > debug("%s(dev=%p):\n", __func__, dev); > > - phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", > - NULL); > + phy_mode = dev_read_string(dev, "phy-mode"); > if (phy_mode) > interface = phy_get_interface_by_name(phy_mode); > > @@ -1991,9 +1990,9 @@ static int eqos_probe(struct udevice *dev) > eqos->dev = dev; > eqos->config = (void *)dev_get_driver_data(dev); > > - eqos->regs = devfdt_get_addr(dev); > + eqos->regs = dev_read_addr(dev); > if (eqos->regs == FDT_ADDR_T_NONE) { > - pr_err("devfdt_get_addr() failed"); > + pr_err("dev_read_addr() failed"); > return -ENODEV; > } > eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE); Reviewed-by: Patrice Chotard <patrice.chotard at st.com> Thanks
Dear David, > From: David Wu <david.wu at rock-chips.com> > Sent: mardi 12 mai 2020 11:56 > > It seems dev_ functions are more general than fdt_ functions. > > Signed-off-by: David Wu <david.wu at rock-chips.com> > --- > > Changes in v2: > - None > > drivers/net/dwc_eth_qos.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index > f67c5f4570..66a02aa80b 100644 > --- a/drivers/net/dwc_eth_qos.c > +++ b/drivers/net/dwc_eth_qos.c > @@ -1889,8 +1889,7 @@ static phy_interface_t > eqos_get_interface_stm32(struct udevice *dev) > > debug("%s(dev=%p):\n", __func__, dev); > > - phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", > - NULL); > + phy_mode = dev_read_string(dev, "phy-mode"); > if (phy_mode) > interface = phy_get_interface_by_name(phy_mode); > > @@ -1991,9 +1990,9 @@ static int eqos_probe(struct udevice *dev) > eqos->dev = dev; > eqos->config = (void *)dev_get_driver_data(dev); > > - eqos->regs = devfdt_get_addr(dev); > + eqos->regs = dev_read_addr(dev); > if (eqos->regs == FDT_ADDR_T_NONE) { > - pr_err("devfdt_get_addr() failed"); > + pr_err("dev_read_addr() failed"); > return -ENODEV; > } > eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE); > -- > 2.19.1 > > Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com> Thanks Patrick
On 5/13/20 2:58 PM, Patrick DELAUNAY wrote: > Dear David, > >> From: David Wu <david.wu at rock-chips.com> >> Sent: mardi 12 mai 2020 11:56 >> >> It seems dev_ functions are more general than fdt_ functions. >> >> Signed-off-by: David Wu <david.wu at rock-chips.com> It seems Joe still didn't come back, I have patches open for two+ months now. What do we do ? [...]
diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index f67c5f4570..66a02aa80b 100644 --- a/drivers/net/dwc_eth_qos.c +++ b/drivers/net/dwc_eth_qos.c @@ -1889,8 +1889,7 @@ static phy_interface_t eqos_get_interface_stm32(struct udevice *dev) debug("%s(dev=%p):\n", __func__, dev); - phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode", - NULL); + phy_mode = dev_read_string(dev, "phy-mode"); if (phy_mode) interface = phy_get_interface_by_name(phy_mode); @@ -1991,9 +1990,9 @@ static int eqos_probe(struct udevice *dev) eqos->dev = dev; eqos->config = (void *)dev_get_driver_data(dev); - eqos->regs = devfdt_get_addr(dev); + eqos->regs = dev_read_addr(dev); if (eqos->regs == FDT_ADDR_T_NONE) { - pr_err("devfdt_get_addr() failed"); + pr_err("dev_read_addr() failed"); return -ENODEV; } eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE);
It seems dev_ functions are more general than fdt_ functions. Signed-off-by: David Wu <david.wu at rock-chips.com> --- Changes in v2: - None drivers/net/dwc_eth_qos.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)