mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 07:51:38 +00:00
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>
This commit is contained in:
parent
d46d27d3b6
commit
b882005a18
1 changed files with 2 additions and 8 deletions
|
@ -1284,22 +1284,16 @@ static int fec_phy_init(struct fec_priv *priv, struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct phy_device *phydev;
|
struct phy_device *phydev;
|
||||||
int addr;
|
int addr;
|
||||||
int mask = 0xffffffff;
|
|
||||||
|
|
||||||
addr = device_get_phy_addr(dev);
|
addr = device_get_phy_addr(dev);
|
||||||
if (addr >= 0)
|
|
||||||
mask = 1 << addr;
|
|
||||||
|
|
||||||
#ifdef CONFIG_FEC_MXC_PHYADDR
|
#ifdef CONFIG_FEC_MXC_PHYADDR
|
||||||
mask = 1 << CONFIG_FEC_MXC_PHYADDR;
|
addr = CONFIG_FEC_MXC_PHYADDR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
phydev = phy_find_by_mask(priv->bus, mask, priv->interface);
|
phydev = phy_connect(priv->bus, addr, dev, priv->interface);
|
||||||
if (!phydev)
|
if (!phydev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
phy_connect_dev(phydev, dev);
|
|
||||||
|
|
||||||
priv->phydev = phydev;
|
priv->phydev = phydev;
|
||||||
phy_config(phydev);
|
phy_config(phydev);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue