Commit e574f398 authored by Guenter Roeck's avatar Guenter Roeck Committed by David S. Miller

net: ethernet: faraday: Use phy_find_first() instead of open coding it

Use phy_find_first() to find the first phy device instead of
open coding it.

Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee64f08e
...@@ -834,20 +834,9 @@ static void ftgmac100_adjust_link(struct net_device *netdev) ...@@ -834,20 +834,9 @@ static void ftgmac100_adjust_link(struct net_device *netdev)
static int ftgmac100_mii_probe(struct ftgmac100 *priv) static int ftgmac100_mii_probe(struct ftgmac100 *priv)
{ {
struct net_device *netdev = priv->netdev; struct net_device *netdev = priv->netdev;
struct phy_device *phydev = NULL; struct phy_device *phydev;
int i;
/* search for connect PHY device */
for (i = 0; i < PHY_MAX_ADDR; i++) {
struct phy_device *tmp = mdiobus_get_phy(priv->mii_bus, i);
if (tmp) {
phydev = tmp;
break;
}
}
/* now we are supposed to have a proper phydev, to attach to... */ phydev = phy_find_first(priv->mii_bus);
if (!phydev) { if (!phydev) {
netdev_info(netdev, "%s: no PHY found\n", netdev->name); netdev_info(netdev, "%s: no PHY found\n", netdev->name);
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment