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:
parent
fffaf05e5d
commit
1c53e68459
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue