Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184306
b: refs/heads/master
c: e4a474f
h: refs/heads/master
v: v3
  • Loading branch information
kirjanov@gmail.com authored and David S. Miller committed Feb 17, 2010
1 parent 4d49b84 commit faf3efc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 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: e76b69cc0133952c98aa1ad6330cacacd269fd64
refs/heads/master: e4a474f82ddaaef65433b0b4f5169f2f6cd8ddb0
24 changes: 10 additions & 14 deletions trunk/drivers/net/smsc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,29 +770,25 @@ static int smsc911x_mii_probe(struct net_device *dev)
{
struct smsc911x_data *pdata = netdev_priv(dev);
struct phy_device *phydev = NULL;
int phy_addr;
int ret;

/* find the first phy */
for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
if (pdata->mii_bus->phy_map[phy_addr]) {
phydev = pdata->mii_bus->phy_map[phy_addr];
SMSC_TRACE(PROBE, "PHY %d: addr %d, phy_id 0x%08X",
phy_addr, phydev->addr, phydev->phy_id);
break;
}
}

phydev = phy_find_first(pdata->mii_bus);
if (!phydev) {
pr_err("%s: no PHY found\n", dev->name);
return -ENODEV;
}

phydev = phy_connect(dev, dev_name(&phydev->dev),
&smsc911x_phy_adjust_link, 0, pdata->config.phy_interface);
SMSC_TRACE(PROBE, "PHY %d: addr %d, phy_id 0x%08X",
phy_addr, phydev->addr, phydev->phy_id);

ret = phy_connect_direct(dev, phydev,
&smsc911x_phy_adjust_link, 0,
pdata->config.phy_interface);

if (IS_ERR(phydev)) {
if (ret) {
pr_err("%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phydev);
return ret;
}

pr_info("%s: attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
Expand Down

0 comments on commit faf3efc

Please sign in to comment.