driver: eth_mcux: gptp: limit rate_adjust range

Limit gptp range_adjust range for improved performance.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
This commit is contained in:
Xabier Marquiegui 2022-01-29 16:34:46 +01:00 committed by David Leach
parent d4c4a14737
commit 62db8ca0e6
1 changed files with 2 additions and 1 deletions

View File

@ -1656,7 +1656,8 @@ static int ptp_clock_mcux_rate_adjust(const struct device *dev, float ratio)
float val;
/* No change needed. */
if (ratio == 1.0f) {
if ((ratio > 1.0 && ratio - 1.0 < 0.00000001) ||
(ratio < 1.0 && 1.0 - ratio < 0.00000001)) {
return 0;
}