aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/dnet.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2016-01-06 20:11:11 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-07 14:31:25 -0500
commit04521bf840482af30a6ed54835cefadcecdd56da (patch)
tree5941a47f26fff38a6b4b04937689b3e281e0cb22 /drivers/net/ethernet/dnet.c
parentphy: add phydev_name() wrapper (diff)
downloadlinux-dev-04521bf840482af30a6ed54835cefadcecdd56da.tar.xz
linux-dev-04521bf840482af30a6ed54835cefadcecdd56da.zip
net: dnet: Use phy_find_first() helper
Replace the open coded search for the first phy with a call to the existing helper function. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/dnet.c')
-rw-r--r--drivers/net/ethernet/dnet.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index 136b6010f704..0ec367521354 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -255,15 +255,9 @@ static int dnet_mii_probe(struct net_device *dev)
{
struct dnet *bp = netdev_priv(dev);
struct phy_device *phydev = NULL;
- int phy_addr;
/* find the first phy */
- for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
- if (bp->mii_bus->phy_map[phy_addr]) {
- phydev = bp->mii_bus->phy_map[phy_addr];
- break;
- }
- }
+ phydev = phy_find_first(bp->mii_bus);
if (!phydev) {
printk(KERN_ERR "%s: no PHY found\n", dev->name);