]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
phy: fix phy address bug
authorGiulio Benetti <giulio.benetti@micronovasrl.com>
Thu, 13 Nov 2008 21:53:13 +0000 (21:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Nov 2008 09:49:41 +0000 (01:49 -0800)
PHYID returns 0xffff and not 0xffffffff when not found and in some
case(at91sam9263) 0x0. Maybe this patch could be useful.

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c

index e11b03b2b25a776c2494951953feeb44777d2f84..8fb1faca883aef9126b547f09ecf830e4feb1562 100644 (file)
@@ -227,8 +227,8 @@ 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, there is no device there */
-       if (0xffffffff == phy_id)
+       /* If the phy_id is all Fs or all 0s, there is no device there */
+       if ((0xffff == phy_id) || (0x00 == phy_id))
                return NULL;
 
        dev = phy_device_create(bus, addr, phy_id);