Commit 547046f2 authored by Stephen Warren's avatar Stephen Warren

cris: move usec/nsec conversion to do_slow_gettimeoffset

Move usec to nsec conversion from arch_gettimeoffset() to
do_slow_gettimeoffset(); in a future patch, do_slow_gettimeoffset()
will be used directly as the implementation of arch_gettimeoffset(),
so needs to perform all required calculations.

Cc: Mikael Starvik <starvik@axis.com>
Cc: linux-cris-kernel@axis.com
Acked-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
parent a49f0d1e
......@@ -65,8 +65,8 @@ unsigned long do_slow_gettimeoffset(void)
*/
count = *R_TIMER0_DATA;
/* Convert timer value to usec */
return (TIMER0_DIV - count) * ((NSEC_PER_SEC/1000)/HZ)/TIMER0_DIV;
/* Convert timer value to nsec */
return (TIMER0_DIV - count) * (NSEC_PER_SEC/HZ)/TIMER0_DIV;
}
/* Excerpt from the Etrax100 HSDD about the built-in watchdog:
......
......@@ -46,7 +46,7 @@ static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
u32 arch_gettimeoffset(void)
{
return do_gettimeoffset() * 1000;
return do_gettimeoffset();
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment