ralink: fix mdio polling of external phys if only 1 phy exists
authorJohn Crispin <john@openwrt.org>
Tue, 11 Nov 2014 11:46:09 +0000 (11:46 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 11 Nov 2014 11:46:09 +0000 (11:46 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 43235

target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620a.c

index e31dd29b42025f2ca5ce31b9947ed4712e391a9f..c0ec939263aa8a29d348c0d6e5f4bd623f184395 100644 (file)
@@ -299,6 +299,9 @@ static void gsw_auto_poll(struct mt7620_gsw *gsw)
                msb = phy;
        }
 
+       if (lsb)
+               lsb--;
+
        gsw_w32(gsw, PHY_AN_EN | PHY_PRE_EN | PMY_MDC_CONF(5) | (msb << 8) | lsb, ESW_PHY_POLLING);
 }