ralink: fix mdio polling of external phys if only 1 phy exists
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 11 Nov 2014 11:46:09 +0000 (11:46 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 11 Nov 2014 11:46:09 +0000 (11:46 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43235 3c298f89-4303-0410-b956-a3cf2f4a3e73

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

index e31dd29..c0ec939 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);
 }