]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
phy:icplus:fix Auto Power Saving in ip101a_config_init.
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Mon, 2 Apr 2012 00:02:09 +0000 (00:02 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 May 2012 21:56:38 +0000 (22:56 +0100)
[ Upstream commit b3300146aa8efc5d3937fd33f3cfdc580a3843bc ]

This patch fixes Auto Power Saving configuration in ip101a_config_init
which was broken as there is no phy register write followed after
setting IP101A_APS_ON flag.

This patch also fixes the return value of ip101a_config_init.

Without this patch ip101a_config_init returns 2 which is not an error
accroding to IS_ERR and the mac driver will continue accessing 2 as
valid pointer to phy_dev resulting in memory fault.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/phy/icplus.c

index c81f136ae670f1c616ac0fee867b9c2ed08351e0..b14230016d9befd4e865776bfe8c459c48f1938c 100644 (file)
@@ -150,7 +150,8 @@ static int ip101a_config_init(struct phy_device *phydev)
        /* Enable Auto Power Saving mode */
        c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
        c |= IP101A_APS_ON;
-       return c;
+
+       return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
 }
 
 static int ip175c_read_status(struct phy_device *phydev)