drivers/net/fec: phy_init: remove redundant logic
authorHannes Schmelzer <hannes.schmelzer@br-automation.com>
Fri, 15 Feb 2019 09:30:18 +0000 (10:30 +0100)
committerStefano Babic <sbabic@denx.de>
Wed, 13 Mar 2019 08:14:35 +0000 (09:14 +0100)
The phy_connect_dev(...) function from phy.c does all the handling
(inclusive catching fixed-link).

So we drop here the single steps and call just phy_connect_dev(...).

Signed-off-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/fec_mxc.c

index a14fe43a5b0aff1907fb29b5b8132201780bf306..f991b40b385a712179fa9911e648c2c9c8d6e84d 100644 (file)
@@ -1284,22 +1284,16 @@ static int fec_phy_init(struct fec_priv *priv, struct udevice *dev)
 {
        struct phy_device *phydev;
        int addr;
-       int mask = 0xffffffff;
 
        addr = device_get_phy_addr(dev);
-       if (addr >= 0)
-               mask = 1 << addr;
-
 #ifdef CONFIG_FEC_MXC_PHYADDR
-       mask = 1 << CONFIG_FEC_MXC_PHYADDR;
+       addr = CONFIG_FEC_MXC_PHYADDR;
 #endif
 
-       phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
+       phydev = phy_connect(priv->bus, addr, dev, priv->interface);
        if (!phydev)
                return -ENODEV;
 
-       phy_connect_dev(phydev, dev);
-
        priv->phydev = phydev;
        phy_config(phydev);