diff options
author | Srinivas Kandagatla <srinivas.kandagatla@st.com> | 2012-04-02 00:02:09 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2012-05-20 22:56:38 +0100 |
commit | 1782d68fba6e18d3674c1d23172929cae6788542 (patch) | |
tree | 283129f9d85b0cf59237ae158b37bd0306f5ea96 /drivers/net | |
parent | 7f2595b65b39999f10347c871cd5146f7bc17532 (diff) |
phy:icplus:fix Auto Power Saving in ip101a_config_init.
[ 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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/icplus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index c81f136ae670..b14230016d9b 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c @@ -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) |