netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: use phy_init_hw instead of open-coding it
@ 2013-11-15  6:09 Florian Fainelli
  2013-11-15  7:03 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2013-11-15  6:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, Florian Fainelli

We already have a helper function which verifies a PHY device driver
implements a config_init callback, then calls phy_scan_fixups() and
ultimately calls the config_init callback. Use that instead of open
coding it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/phy/phy.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 36c6994..1e5de8c 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -360,11 +360,8 @@ int phy_mii_ioctl(struct phy_device *phydev,
 			      mii_data->reg_num, val);
 
 		if (mii_data->reg_num == MII_BMCR &&
-		    val & BMCR_RESET &&
-		    phydev->drv->config_init) {
-			phy_scan_fixups(phydev);
-			phydev->drv->config_init(phydev);
-		}
+		    val & BMCR_RESET)
+			phy_init_hw(phydev);
 		break;
 
 	case SIOCSHWTSTAMP:
-- 
1.8.3.2

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

* Re: [PATCH net-next] net: phy: use phy_init_hw instead of open-coding it
  2013-11-15  6:09 [PATCH net-next] net: phy: use phy_init_hw instead of open-coding it Florian Fainelli
@ 2013-11-15  7:03 ` Florian Fainelli
  2013-11-15  7:30   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2013-11-15  7:03 UTC (permalink / raw)
  To: davem; +Cc: netdev

Le vendredi 15 novembre 2013, 06:09:53 Florian Fainelli a écrit :
> We already have a helper function which verifies a PHY device driver
> implements a config_init callback, then calls phy_scan_fixups() and
> ultimately calls the config_init callback. Use that instead of open
> coding it.

I did not realize we were in the middle of the merge window, I will re-submit 
once net-next is open again since this is not a fix.
-- 
Florian

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

* Re: [PATCH net-next] net: phy: use phy_init_hw instead of open-coding it
  2013-11-15  7:03 ` Florian Fainelli
@ 2013-11-15  7:30   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-11-15  7:30 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 15 Nov 2013 07:03:04 +0000

> Le vendredi 15 novembre 2013, 06:09:53 Florian Fainelli a écrit :
>> We already have a helper function which verifies a PHY device driver
>> implements a config_init callback, then calls phy_scan_fixups() and
>> ultimately calls the config_init callback. Use that instead of open
>> coding it.
> 
> I did not realize we were in the middle of the merge window, I will re-submit 
> once net-next is open again since this is not a fix.

Thank you.

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

end of thread, other threads:[~2013-11-15  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15  6:09 [PATCH net-next] net: phy: use phy_init_hw instead of open-coding it Florian Fainelli
2013-11-15  7:03 ` Florian Fainelli
2013-11-15  7:30   ` David Miller

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).