Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202899
b: refs/heads/master
c: 637f33b
h: refs/heads/master
i:
  202897: 2b9586e
  202895: efbe555
v: v3
  • Loading branch information
Jonas Bonn authored and David S. Miller committed Jun 11, 2010
1 parent 11ca93b commit ddcc5b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 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: ee4f56b990391f0ea333121ebc0e9fba28619b52
refs/heads/master: 637f33b80d774060646772a22fd728e198d9ebf9
24 changes: 8 additions & 16 deletions trunk/drivers/net/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,33 +635,25 @@ static int ethoc_mdio_probe(struct net_device *dev)
{
struct ethoc *priv = netdev_priv(dev);
struct phy_device *phy;
int err;
int i;

for (i = 0; i < PHY_MAX_ADDR; i++) {
phy = priv->mdio->phy_map[i];
if (phy) {
if (priv->phy_id != -1) {
/* attach to specified PHY */
if (priv->phy_id == phy->addr)
break;
} else {
/* autoselect PHY if none was specified */
if (phy->addr != 0)
break;
}
}
if (priv->phy_id != -1) {
phy = priv->mdio->phy_map[priv->phy_id];
} else {
phy = phy_find_first(priv->mdio);
}

if (!phy) {
dev_err(&dev->dev, "no PHY found\n");
return -ENXIO;
}

phy = phy_connect(dev, dev_name(&phy->dev), ethoc_mdio_poll, 0,
err = phy_connect_direct(dev, phy, ethoc_mdio_poll, 0,
PHY_INTERFACE_MODE_GMII);
if (IS_ERR(phy)) {
if (err) {
dev_err(&dev->dev, "could not attach to PHY\n");
return PTR_ERR(phy);
return err;
}

priv->phy = phy;
Expand Down

0 comments on commit ddcc5b7

Please sign in to comment.