drivers: nrf_rtc_timer: Remove unnecessary locking

As per description of the sys_clock_elapsed() function, "the kernel
will call this with appropriate locking, the driver needs only provide
an instantaneous answer". Remove then the unnecessary locking from the
function, as it only adds an undesirable delay.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2021-05-24 11:46:07 +02:00 committed by Anas Nashif
commit 457a28bf78

View file

@ -386,11 +386,7 @@ uint32_t sys_clock_elapsed(void)
return 0; return 0;
} }
k_spinlock_key_t key = k_spin_lock(&lock); return counter_sub(counter(), last_count) / CYC_PER_TICK;
uint32_t ret = counter_sub(counter(), last_count) / CYC_PER_TICK;
k_spin_unlock(&lock, key);
return ret;
} }
uint32_t sys_clock_cycle_get_32(void) uint32_t sys_clock_cycle_get_32(void)