[U-Boot] [PATCH] drivers/net/phy/fixed: do not overwrite addr

Hannes Schmelzer Hannes.Schmelzer at br-automation.com
Tue Jun 6 12:51:41 UTC 2017


"U-Boot" <u-boot-bounces at lists.denx.de> schrieb am 06.06.2017 14:35:29:

> Von: Christian Gmeiner <christian.gmeiner at gmail.com>
> An: u-boot at lists.denx.de, 
> Kopie: joe.hershberger at ni.com, oe5hpm at oevsv.at
> Datum: 06.06.2017 14:35
> Betreff: [U-Boot] [PATCH] drivers/net/phy/fixed: do not overwrite addr
> Gesendet von: "U-Boot" <u-boot-bounces at lists.denx.de>
> 
> phy_device_create(..) sets the addr of phy_device with a sane value.
> There is no need overwrite it.

Hi Christian,

The addr=0 was not an accident.
Since there is no real phy in this case outside, i did set the address to 
zero (no real phy has address #0),
later on in the board_phy_config(...) i look at the phydev->addr for 
detecting that i deal with the "fixed-link" driver.

But for sure there are better ways to handle this, any suggestion ?

cheers,
Hannes

> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  drivers/net/phy/fixed.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
> index df82356..e8e9099 100644
> --- a/drivers/net/phy/fixed.c
> +++ b/drivers/net/phy/fixed.c
> @@ -34,7 +34,6 @@ int fixedphy_probe(struct phy_device *phydev)
>     memset(priv, 0, sizeof(*priv));
> 
>     phydev->priv = priv;
> -   phydev->addr = 0;
> 
>     priv->link_speed = val;
>     priv->duplex = fdtdec_get_bool(gd->fdt_blob, ofnode, "full-duplex");
> -- 
> 2.9.4
> 




More information about the U-Boot mailing list