aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Schmelzer2019-02-15 10:30:18 +0100
committerStefano Babic2019-03-13 09:14:35 +0100
commitb882005a18dec45848e153dcf8d29b4a2feecf14 (patch)
tree6e63cae229ebf950eeca9efaeb749dbbd80005ae
parentd46d27d3b6558904b8fb44e90393f11c54ef3363 (diff)
drivers/net/fec: phy_init: remove redundant logic
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>
-rw-r--r--drivers/net/fec_mxc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index a14fe43a5b0..f991b40b385 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -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);