aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2016-06-16 02:08:29 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-16 20:08:33 -0400
commitfae5617877f2e1040106385d94529f30780525e1 (patch)
tree2147a8926c585ff956ded1eead44b38d80b2fbd1 /drivers/net/usb
parentd21cfb375eb07ce294ac29a0a51e45413fc8506d (diff)
r8152: modify the check of the flag of PHY_RESET in set_speed function
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/r8152.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 69d1bbfd1fa0..11178f9dc838 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)
2872 bmcr = BMCR_ANENABLE | BMCR_ANRESTART; 2872 bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
2873 } 2873 }
2874 2874
2875 if (test_bit(PHY_RESET, &tp->flags)) 2875 if (test_and_clear_bit(PHY_RESET, &tp->flags))
2876 bmcr |= BMCR_RESET; 2876 bmcr |= BMCR_RESET;
2877 2877
2878 if (tp->mii.supports_gmii) 2878 if (tp->mii.supports_gmii)
@@ -2881,7 +2881,7 @@ static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u16 speed, u8 duplex)
2881 r8152_mdio_write(tp, MII_ADVERTISE, anar); 2881 r8152_mdio_write(tp, MII_ADVERTISE, anar);
2882 r8152_mdio_write(tp, MII_BMCR, bmcr); 2882 r8152_mdio_write(tp, MII_BMCR, bmcr);
2883 2883
2884 if (test_and_clear_bit(PHY_RESET, &tp->flags)) { 2884 if (bmcr & BMCR_RESET) {
2885 int i; 2885 int i;
2886 2886
2887 for (i = 0; i < 50; i++) { 2887 for (i = 0; i < 50; i++) {