Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202658
b: refs/heads/master
c: 1273d97
h: refs/heads/master
v: v3
  • Loading branch information
Denis Kirjanov authored and David S. Miller committed Jun 3, 2010
1 parent be26499 commit 54c1cbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c7621cb3d9a2c42d2fed7e16845611c8c6fd5835
refs/heads/master: 1273d97674a1782ff55b823aa6c40aea9b538aaf
16 changes: 5 additions & 11 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,30 +679,24 @@ static int fec_enet_mii_probe(struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
struct phy_device *phy_dev = NULL;
int phy_addr;
int ret;

fep->phy_dev = NULL;

/* find the first phy */
for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
if (fep->mii_bus->phy_map[phy_addr]) {
phy_dev = fep->mii_bus->phy_map[phy_addr];
break;
}
}

phy_dev = phy_find_first(fep->mii_bus);
if (!phy_dev) {
printk(KERN_ERR "%s: no PHY found\n", dev->name);
return -ENODEV;
}

/* attach the mac to the phy */
phy_dev = phy_connect(dev, dev_name(&phy_dev->dev),
ret = phy_connect_direct(dev, phy_dev,
&fec_enet_adjust_link, 0,
PHY_INTERFACE_MODE_MII);
if (IS_ERR(phy_dev)) {
if (ret) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phy_dev);
return ret;
}

/* mask with MAC supported features */
Expand Down

0 comments on commit 54c1cbe

Please sign in to comment.