File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
features/netsocket/emac-drivers/TARGET_NUVOTON_EMAC Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ static int reset_phy(void)
7878 mdio_write (CONFIG_PHY_ADDR , MII_BMCR , BMCR_RESET );
7979
8080 delayCnt = 2000 ;
81- while (delayCnt -- > 0 ) {
81+ while (delayCnt > 0 ) {
82+ delayCnt -- ;
8283 if ((mdio_read (CONFIG_PHY_ADDR , MII_BMCR ) & BMCR_RESET ) == 0 )
8384 break ;
8485
@@ -99,7 +100,8 @@ static int reset_phy(void)
99100 mdio_write (CONFIG_PHY_ADDR , MII_BMCR , reg | BMCR_ANRESTART );
100101
101102 delayCnt = 200000 ;
102- while (delayCnt -- > 0 ) {
103+ while (delayCnt > 0 ) {
104+ delayCnt -- ;
103105 if ((mdio_read (CONFIG_PHY_ADDR , MII_BMSR ) & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS ))
104106 == (BMSR_ANEGCOMPLETE | BMSR_LSTATUS ))
105107 break ;
Original file line number Diff line number Diff line change @@ -78,7 +78,8 @@ static int reset_phy(void)
7878 mdio_write (CONFIG_PHY_ADDR , MII_BMCR , BMCR_RESET );
7979
8080 delayCnt = 2000 ;
81- while (delayCnt -- > 0 ) {
81+ while (delayCnt > 0 ) {
82+ delayCnt -- ;
8283 if ((mdio_read (CONFIG_PHY_ADDR , MII_BMCR ) & BMCR_RESET ) == 0 )
8384 break ;
8485
@@ -99,7 +100,8 @@ static int reset_phy(void)
99100 mdio_write (CONFIG_PHY_ADDR , MII_BMCR , reg | BMCR_ANRESTART );
100101
101102 delayCnt = 200000 ;
102- while (delayCnt -- > 0 ) {
103+ while (delayCnt > 0 ) {
104+ delayCnt -- ;
103105 if ((mdio_read (CONFIG_PHY_ADDR , MII_BMSR ) & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS ))
104106 == (BMSR_ANEGCOMPLETE | BMSR_LSTATUS ))
105107 break ;
You can’t perform that action at this time.
0 commit comments