[RESEND PATCH v2 01/11] net: dwc_eth_qos: Use dev_ functions calls to get FDT data

Patrice CHOTARD patrice.chotard at st.com
Wed May 13 10:09:12 CEST 2020


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


More information about the U-Boot mailing list