Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 119601
b: refs/heads/master
c: 6436cbc
h: refs/heads/master
i:
  119599: 4a6032e
v: v3
  • Loading branch information
Giuseppe Cavallaro authored and David S. Miller committed Nov 21, 2008
1 parent 876e890 commit 9b6bb22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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: 75e07fc3d87ba9b3255e1fcd735186a533ea0754
refs/heads/master: 6436cbcd735a11fc93bf3353c68914bc545e6d1e
13 changes: 11 additions & 2 deletions trunk/drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,17 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
if (r)
return ERR_PTR(r);

/* If the phy_id is all Fs or all 0s, there is no device there */
if ((0xffff == phy_id) || (0x00 == phy_id))
/* If the phy_id is mostly Fs, there is no device there */
if ((phy_id & 0x1fffffff) == 0x1fffffff)
return NULL;

/*
* Broken hardware is sometimes missing the pull down resistor on the
* MDIO line, which results in reads to non-existent devices returning
* 0 rather than 0xffff. Catch this here and treat 0 as a non-existent
* device as well.
*/
if (phy_id == 0)
return NULL;

dev = phy_device_create(bus, addr, phy_id);
Expand Down

0 comments on commit 9b6bb22

Please sign in to comment.