In function get_phy_device_by_mask(), when trying Clause 45,
we should extend the value of devad(used in create_phy_by_mask)
to zero to cover more PHYs (e.g. devad must be 0 for CS4315 PHY).

Signed-off-by: Shengzhou Liu <shengzhou....@freescale.com>
---
 drivers/net/phy/phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index c8e7f64..7e9f2b2 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -647,9 +647,9 @@ static struct phy_device *get_phy_device_by_mask(struct 
mii_dev *bus,
                return phydev;
        /* Try Standard (ie Clause 22) access */
        /* Otherwise we have to try Clause 45 */
-       for (i = 0; i < 5; i++) {
+       for (i = 0; i < 6; i++) {
                phydev = create_phy_by_mask(bus, phy_mask,
-                               i ? i : MDIO_DEVAD_NONE, interface);
+                               i ? i - 1 : MDIO_DEVAD_NONE, interface);
                if (IS_ERR(phydev))
                        return NULL;
                if (phydev)
-- 
1.8.0


_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to