projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d21cfb3
)
r8152: modify the check of the flag of PHY_RESET in set_speed function
author
hayeswang
<
[email protected]
>
Thu, 16 Jun 2016 06:08:29 +0000
(14:08 +0800)
committer
David S. Miller
<
[email protected]
>
Fri, 17 Jun 2016 00:08:33 +0000
(17:08 -0700)
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 <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/usb/r8152.c
patch
|
blob
|
history
diff --git
a/drivers/net/usb/r8152.c
b/drivers/net/usb/r8152.c
index 69d1bbfd1fa0a907532d08d35c5bcbfce80fe79b..11178f9dc838a95b6739aa740e08b32ccd259a4d 100644
(file)
--- 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++) {