Commit 3ee82383 authored by Giulio Benetti's avatar Giulio Benetti Committed by David S. Miller

phy: fix phy address bug

PHYID returns 0xffff and not 0xffffffff when not found and in some
case(at91sam9263) 0x0. Maybe this patch could be useful.
Signed-off-by: default avatarGiulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 773c9c1f
...@@ -227,8 +227,8 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr) ...@@ -227,8 +227,8 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr)
if (r) if (r)
return ERR_PTR(r); return ERR_PTR(r);
/* If the phy_id is all Fs, there is no device there */ /* If the phy_id is all Fs or all 0s, there is no device there */
if (0xffffffff == phy_id) if ((0xffff == phy_id) || (0x00 == phy_id))
return NULL; return NULL;
dev = phy_device_create(bus, addr, phy_id); dev = phy_device_create(bus, addr, phy_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment