drivers: ethernet: mcux: Bugfix ptp_clock_adjust

ptp_clock_adjust() API call for mcux driver has a bug where
increment gets compared with an unsigned int, causing it to
always return -EINVAL.

Signed-off-by: Alex Sergeev <asergeev@carbonrobotics.com>
This commit is contained in:
Alex Sergeev 2021-09-20 23:59:24 -07:00 committed by Christopher Friedt
commit 1c53e68459

View file

@ -1456,7 +1456,8 @@ static int ptp_clock_mcux_adjust(const struct device *dev, int increment)
ARG_UNUSED(dev);
if ((increment <= -NSEC_PER_SEC) || (increment >= NSEC_PER_SEC)) {
if ((increment <= (int32_t)(-NSEC_PER_SEC)) ||
(increment >= (int32_t)NSEC_PER_SEC)) {
ret = -EINVAL;
} else {
key = irq_lock();