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


Groups > linux.kernel > #1423694

[PATCH net-next] r8152: modify the check of the flag of PHY_RESET in set_speed function

From Hayes Wang <hayeswang@realtek.com>
Newsgroups linux.kernel
Subject [PATCH net-next] r8152: modify the check of the flag of PHY_RESET in set_speed function
Date 2016-06-16 08:10 +0200
Message-ID <rKyF3-4EY-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


In set_speed(), BMCR_RESET would be set when the flag of PHY_RESET
is set. Use BMCR_RESET to replace testing the flag of PHY_RESET.

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

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 69d1bbfd..11178f9 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2872,7 +2872,7 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
 		bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
 	}
 
-	if (test_bit(PHY_RESET, &tp->flags))
+	if (test_and_clear_bit(PHY_RESET, &tp->flags))
 		bmcr |= BMCR_RESET;
 
 	if (tp->mii.supports_gmii)
@@ -2881,7 +2881,7 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
 	r8152_mdio_write(tp, MII_ADVERTISE, anar);
 	r8152_mdio_write(tp, MII_BMCR, bmcr);
 
-	if (test_and_clear_bit(PHY_RESET, &tp->flags)) {
+	if (bmcr & BMCR_RESET) {
 		int i;
 
 		for (i = 0; i < 50; i++) {
-- 
2.4.11

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


Thread

[PATCH net-next] r8152: modify the check of the flag of PHY_RESET in set_speed function Hayes Wang <hayeswang@realtek.com> - 2016-06-16 08:10 +0200
  Re: [PATCH net-next] r8152: modify the check of the flag of  PHY_RESET in set_speed function David Miller <davem@davemloft.net> - 2016-06-17 02:10 +0200

csiph-web