diff options
author | Guenter Roeck <linux@roeck-us.net> | 2016-01-10 21:04:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-11 04:05:30 +0100 |
commit | e574f39816f0227e3f43806952c8bc551d61770a (patch) | |
tree | bdb80ba6d0d97bd16cef3194ba17b1918922f30b /drivers/net/ethernet/faraday/ftgmac100.c | |
parent | net: ethernet: broadcom: Fix build errors (diff) | |
download | linux-e574f39816f0227e3f43806952c8bc551d61770a.tar.xz linux-e574f39816f0227e3f43806952c8bc551d61770a.zip |
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: Guenter Roeck <linux@roeck-us.net>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/faraday/ftgmac100.c')
-rw-r--r-- | drivers/net/ethernet/faraday/ftgmac100.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index bb116ad646f6..84384e1585a5 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -834,20 +834,9 @@ static void ftgmac100_adjust_link(struct net_device *netdev) static int ftgmac100_mii_probe(struct ftgmac100 *priv) { struct net_device *netdev = priv->netdev; - struct phy_device *phydev = NULL; - 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; - } - } + struct phy_device *phydev; - /* now we are supposed to have a proper phydev, to attach to... */ + phydev = phy_find_first(priv->mii_bus); if (!phydev) { netdev_info(netdev, "%s: no PHY found\n", netdev->name); return -ENODEV; |