Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04521bf8 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

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: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 84eff6d1
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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);