net: designware: use 'phy_connect' instead of open coded
PATCH 1/1 net: designware: use 'phy_connect' instead of open coded
Using 'phy_connect' instead of 'phy_find_by_mask' and 'phy_connect_dev' both deduplicates code and adds support for 'fixed-link'.
Signed-off-by Simon Goldschmidt <[email protected]>
---
drivers/net/designware.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/designware.c +3 -5
@@ -480,18 +480,16 @@ static int _dw_free_pkt(struct dw_eth_dev *priv)static int dw_phy_init (struct dw_eth_dev *priv,void *dev) {struct phy_device *phydev; -int mask =0xffffffff , ret; +int phy_addr =-1 , ret;#ifdef CONFIG_PHY_ADDR - mask =1 <<CONFIG_PHY_ADDR ; + phy_addr =CONFIG_PHY_ADDR ;#endif - phydev =phy_find_by_mask (priv->bus, mask, priv->interface); + phydev =phy_connect (priv->bus, phy_addr, dev, priv->interface);if (!phydev)return -ENODEV ; -phy_connect_dev (phydev, dev); - phydev->supported &=PHY_GBIT_FEATURES ;if (priv->max_speed) { ret =phy_set_supported (phydev, priv->max_speed);
Signature · 1 line
2.20.1
PATCH 1/1 net: designware: use 'phy_connect' instead of open coded
Quoted 5 lines · Simon Goldschmidt
Using '
phy_connect' instead of 'phy_find_by_mask' and 'phy_connect_dev' both deduplicates code and adds support for 'fixed-link'.Signed-off-by Simon Goldschmidt <[email protected]>
Acked-by Joe Hershberger <[email protected]>
Hi Simon,
https://patchwork.ozlabs.org/patch/1132238/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks!
-Joe