Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1438217

[PATCH net-next 1/3] r8152: remove rtl_phy_reset function

From Hayes Wang <hayeswang@realtek.com>
Newsgroups linux.kernel
Subject [PATCH net-next 1/3] r8152: remove rtl_phy_reset function
Date 2016-07-07 09:20 +0200
Message-ID <rSbLk-3Kd-17@gated-at.bofh.it> (permalink)
References <rSbLk-3Kd-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


In rtl_hw_phy_work_func_t(), the flag of PHY_RESET is set in
rtl_ops.hw_phy_cfg() and cleared in rtl8152_set_speed(). Therefore,
the rtl_phy_reset() is never run and is unnecessary.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index b225bc2..e005ee6 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2450,27 +2450,6 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
 	}
 }
 
-static void rtl_phy_reset(struct r8152 *tp)
-{
-	u16 data;
-	int i;
-
-	data = r8152_mdio_read(tp, MII_BMCR);
-
-	/* don't reset again before the previous one complete */
-	if (data & BMCR_RESET)
-		return;
-
-	data |= BMCR_RESET;
-	r8152_mdio_write(tp, MII_BMCR, data);
-
-	for (i = 0; i < 50; i++) {
-		msleep(20);
-		if ((r8152_mdio_read(tp, MII_BMCR) & BMCR_RESET) == 0)
-			break;
-	}
-}
-
 static void r8153_teredo_off(struct r8152 *tp)
 {
 	u32 ocp_data;
@@ -3069,9 +3048,6 @@ static void rtl_work_func_t(struct work_struct *work)
 	    netif_carrier_ok(tp->netdev))
 		napi_schedule(&tp->napi);
 
-	if (test_and_clear_bit(PHY_RESET, &tp->flags))
-		rtl_phy_reset(tp);
-
 	mutex_unlock(&tp->control);
 
 out1:
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/3] r8152: remove the redundant code Hayes Wang <hayeswang@realtek.com> - 2016-07-07 09:20 +0200
  [PATCH net-next 1/3] r8152: remove rtl_phy_reset function Hayes Wang <hayeswang@realtek.com> - 2016-07-07 09:20 +0200
  [PATCH net-next 2/3] r8152: remove a netif_carrier_off in rtl8152_open function Hayes Wang <hayeswang@realtek.com> - 2016-07-07 09:20 +0200
  Re: [PATCH net-next 0/3] r8152: remove the redundant code David Miller <davem@davemloft.net> - 2016-07-09 23:50 +0200

csiph-web