net: phy: Move fixed link code to separate routine
This patch moves fixed-link functionality code to a separate routine inorder to make it more modular and cleaner. Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
e7c9de6617
commit
c256d3f7c5
@ -876,18 +876,18 @@ void phy_connect_dev(struct phy_device *phydev, struct eth_device *dev)
|
|||||||
debug("%s connected to %s\n", dev->name, phydev->drv->name);
|
debug("%s connected to %s\n", dev->name, phydev->drv->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_PHY_FIXED
|
||||||
#ifdef CONFIG_DM_ETH
|
#ifdef CONFIG_DM_ETH
|
||||||
struct phy_device *phy_connect(struct mii_dev *bus, int addr,
|
static struct phy_device *phy_connect_fixed(struct mii_dev *bus,
|
||||||
struct udevice *dev,
|
struct udevice *dev,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
#else
|
#else
|
||||||
struct phy_device *phy_connect(struct mii_dev *bus, int addr,
|
static struct phy_device *phy_connect_fixed(struct mii_dev *bus,
|
||||||
struct eth_device *dev,
|
struct eth_device *dev,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
struct phy_device *phydev = NULL;
|
struct phy_device *phydev = NULL;
|
||||||
#ifdef CONFIG_PHY_FIXED
|
|
||||||
int sn;
|
int sn;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
@ -901,7 +901,27 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
|
|||||||
}
|
}
|
||||||
sn = fdt_next_subnode(gd->fdt_blob, sn);
|
sn = fdt_next_subnode(gd->fdt_blob, sn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return phydev;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_DM_ETH
|
||||||
|
struct phy_device *phy_connect(struct mii_dev *bus, int addr,
|
||||||
|
struct udevice *dev,
|
||||||
|
phy_interface_t interface)
|
||||||
|
#else
|
||||||
|
struct phy_device *phy_connect(struct mii_dev *bus, int addr,
|
||||||
|
struct eth_device *dev,
|
||||||
|
phy_interface_t interface)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
struct phy_device *phydev = NULL;
|
||||||
|
|
||||||
|
#ifdef CONFIG_PHY_FIXED
|
||||||
|
phydev = phy_connect_fixed(bus, dev, interface);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!phydev)
|
if (!phydev)
|
||||||
phydev = phy_find_by_mask(bus, 1 << addr, interface);
|
phydev = phy_find_by_mask(bus, 1 << addr, interface);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user