File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ struct phy_mii_dev_data {
41
41
struct k_work_delayable autoneg_work ;
42
42
bool gigabit_supported ;
43
43
bool restart_autoneg ;
44
- uint32_t autoneg_timeout ;
44
+ k_timepoint_t autoneg_timeout ;
45
45
#endif
46
46
};
47
47
@@ -213,7 +213,7 @@ static int update_link_state(const struct device *dev)
213
213
data -> restart_autoneg = false;
214
214
215
215
/* We have to wait for the auto-negotiation process to complete */
216
- data -> autoneg_timeout = CONFIG_PHY_AUTONEG_TIMEOUT_MS / MII_AUTONEG_POLL_INTERVAL_MS ;
216
+ data -> autoneg_timeout = sys_timepoint_calc ( K_MSEC ( CONFIG_PHY_AUTONEG_TIMEOUT_MS )) ;
217
217
return - EINPROGRESS ;
218
218
}
219
219
@@ -245,7 +245,7 @@ static int check_autonegotiation_completion(const struct device *dev)
245
245
}
246
246
247
247
if (!(bmsr_reg & MII_BMSR_AUTONEG_COMPLETE )) {
248
- if (data -> autoneg_timeout -- == 0U ) {
248
+ if (sys_timepoint_expired ( data -> autoneg_timeout ) ) {
249
249
LOG_DBG ("PHY (%d) auto-negotiate timedout" , cfg -> phy_addr );
250
250
return - ETIMEDOUT ;
251
251
}
You can’t perform that action at this time.
0 commit comments