Revert "clocksource/drivers/imx-tpm: Fix return -ETIME when delta exceeds INT_MAX"
This reverts commit 36e2da06de
.
This commit is contained in:
parent
983be60aeb
commit
10e292d1f6
1 changed files with 4 additions and 4 deletions
|
@ -83,10 +83,10 @@ static u64 notrace tpm_read_sched_clock(void)
|
|||
static int tpm_set_next_event(unsigned long delta,
|
||||
struct clock_event_device *evt)
|
||||
{
|
||||
unsigned long next, prev, now;
|
||||
unsigned long next, now;
|
||||
|
||||
prev = tpm_read_counter();
|
||||
next = prev + delta;
|
||||
next = tpm_read_counter();
|
||||
next += delta;
|
||||
writel(next, timer_base + TPM_C0V);
|
||||
now = tpm_read_counter();
|
||||
|
||||
|
@ -96,7 +96,7 @@ static int tpm_set_next_event(unsigned long delta,
|
|||
* of writing CNT registers which may cause the min_delta event got
|
||||
* missed, so we need add a ETIME check here in case it happened.
|
||||
*/
|
||||
return (now - prev) >= delta ? -ETIME : 0;
|
||||
return (int)(next - now) <= 0 ? -ETIME : 0;
|
||||
}
|
||||
|
||||
static int tpm_set_state_oneshot(struct clock_event_device *evt)
|
||||
|
|
Loading…
Reference in a new issue