[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201103041825.48765.florian@openwrt.org>
Date: Fri, 4 Mar 2011 18:25:48 +0100
From: Florian Fainelli <florian@...nwrt.org>
To: netdev@...r.kernel.org
Cc: David Miller <davem@...emloft.net>,
Andy Fleming <afleming@...escale.com>
Subject: mii_bus->read return checking in phy_device.c
Hello Andy,
While debugging a PHY probing issue with the au1000_eth, I stumbled upon this
in drivers/net/phy/phy_device.c:
phy_reg = bus->read(bus, addr, MII_PHYSID1);
if (phy_reg < 0)
return -EIO;
most drivers implement phylib's mdio_read callback by simply returning the
contents of their MDIO register after a readl, ioread ... which is unsigned.
Would not it rather make sense to check for phy_reg <= 0 instead?
This can lead for instance to believing that a PHY is present at a wrong
address because the MDIO read function returns 0 for that particular register,
which is logical because no PHY is present at that address.
I am asking in case I just miss something.
Thank you.
--
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists