Skip to content

Commit

Permalink
net: dnet: Use phy_find_first() helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Jan 7, 2016
1 parent 84eff6d commit 04521bf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/net/ethernet/dnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 04521bf

Please sign in to comment.