Merge pull request #12839 from sword-huang/master

Nuvoton: netsocket correction of judgment errors
pull/12856/head
Martin Kojtal 2020-04-30 14:54:07 +02:00 committed by GitHub
commit 6d8d024eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -78,7 +78,8 @@ static int reset_phy(void)
mdio_write(CONFIG_PHY_ADDR, MII_BMCR, BMCR_RESET);
delayCnt = 2000;
while(delayCnt-- > 0) {
while(delayCnt > 0) {
delayCnt--;
if((mdio_read(CONFIG_PHY_ADDR, MII_BMCR) & BMCR_RESET) == 0)
break;
@ -99,7 +100,8 @@ static int reset_phy(void)
mdio_write(CONFIG_PHY_ADDR, MII_BMCR, reg | BMCR_ANRESTART);
delayCnt = 200000;
while(delayCnt-- > 0) {
while(delayCnt > 0) {
delayCnt--;
if((mdio_read(CONFIG_PHY_ADDR, MII_BMSR) & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS))
== (BMSR_ANEGCOMPLETE | BMSR_LSTATUS))
break;

View File

@ -78,7 +78,8 @@ static int reset_phy(void)
mdio_write(CONFIG_PHY_ADDR, MII_BMCR, BMCR_RESET);
delayCnt = 2000;
while(delayCnt-- > 0) {
while(delayCnt > 0) {
delayCnt--;
if((mdio_read(CONFIG_PHY_ADDR, MII_BMCR) & BMCR_RESET) == 0)
break;
@ -99,7 +100,8 @@ static int reset_phy(void)
mdio_write(CONFIG_PHY_ADDR, MII_BMCR, reg | BMCR_ANRESTART);
delayCnt = 200000;
while(delayCnt-- > 0) {
while(delayCnt > 0) {
delayCnt--;
if((mdio_read(CONFIG_PHY_ADDR, MII_BMSR) & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS))
== (BMSR_ANEGCOMPLETE | BMSR_LSTATUS))
break;