netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.3.0] phy:icplus:fix Auto Power Saving in ip101a_config_init.
@ 2012-04-02 10:02 Srinivas KANDAGATLA
  2012-04-03 22:49 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Srinivas KANDAGATLA @ 2012-04-02 10:02 UTC (permalink / raw)
  To: netdev; +Cc: davem, peppe.cavallaro, srinivas.kandagatla

From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

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>
---
Hi All, 
This patch fixes broken ip101a_config_init in icplus.c.

Thanks,
srini

 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 0856e1b..f08c85a 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -162,7 +162,8 @@ static int ip101a_g_config_init(struct phy_device *phydev)
 	/* Enable Auto Power Saving mode */
 	c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
 	c |= IP101A_G_APS_ON;
-	return c;
+
+	return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
 }
 
 static int ip175c_read_status(struct phy_device *phydev)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-12  0:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 10:02 [PATCH 3.3.0] phy:icplus:fix Auto Power Saving in ip101a_config_init Srinivas KANDAGATLA
2012-04-03 22:49 ` David Miller
2012-05-09  7:25   ` Jonathan Nieder
2012-05-09 15:57     ` David Miller
2012-05-09 17:18       ` [3.2.y] " Jonathan Nieder
2012-05-12  0:57         ` Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).