Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184004
b: refs/heads/master
c: 7455a76
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Feb 12, 2010
1 parent e518edc commit fa851ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 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: 4cd24eaf0c6ee7f0242e34ee77ec899f255e66b5
refs/heads/master: 7455a76f170f794498d26081a5f15b797ef1a2aa
29 changes: 9 additions & 20 deletions trunk/drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,11 @@ static void macb_handle_link_change(struct net_device *dev)
static int macb_mii_probe(struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
struct phy_device *phydev = NULL;
struct phy_device *phydev;
struct eth_platform_data *pdata;
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;
}
}
int ret;

phydev = phy_find_first(bp->mii_bus);
if (!phydev) {
printk (KERN_ERR "%s: no PHY found\n", dev->name);
return -1;
Expand All @@ -210,17 +203,13 @@ static int macb_mii_probe(struct net_device *dev)
/* TODO : add pin_irq */

/* attach the mac to the phy */
if (pdata && pdata->is_rmii) {
phydev = phy_connect(dev, dev_name(&phydev->dev),
&macb_handle_link_change, 0, PHY_INTERFACE_MODE_RMII);
} else {
phydev = phy_connect(dev, dev_name(&phydev->dev),
&macb_handle_link_change, 0, PHY_INTERFACE_MODE_MII);
}

if (IS_ERR(phydev)) {
ret = phy_connect_direct(dev, phydev, &macb_handle_link_change, 0,
pdata && pdata->is_rmii ?
PHY_INTERFACE_MODE_RMII :
PHY_INTERFACE_MODE_MII);
if (ret) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phydev);
return ret;
}

/* mask with MAC supported features */
Expand Down

0 comments on commit fa851ef

Please sign in to comment.