Skip to content

Commit

Permalink
r8152: modify the check of the flag of PHY_RESET in set_speed function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hayesorz authored and davem330 committed Jun 17, 2016
1 parent d21cfb3 commit fae5617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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++) {
Expand Down

0 comments on commit fae5617

Please sign in to comment.