lkml.org 
[lkml]   [2014]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 20/28] nios2: Time keeping
Date
On Friday 18 April 2014, Ley Foon Tan wrote:
> +static inline unsigned long read_timersnapshot(void)
> +{
> + unsigned long count;
> +
> + outw(0, timer_membase + ALTERA_TIMER_SNAPL_REG);
> + count =
> + inw(timer_membase + ALTERA_TIMER_SNAPH_REG) << 16 |
> + inw(timer_membase + ALTERA_TIMER_SNAPL_REG);
> +
> + return count;
> +}
> +
> +static inline void write_timerperiod(unsigned long period)
> +{
> + outw(period, timer_membase + ALTERA_TIMER_PERIODL_REG);
> + outw(period >> 16, timer_membase + ALTERA_TIMER_PERIODH_REG);
> +}

It's wrong to use 'outw' if this device is not on an PC-style ISA bus,
which I assume it is not. Since timer_membase is an __iomem pointer,
I'm sure you want to use writew() instead.

Arnd


\
 
 \ /
  Last update: 2014-04-22 17:21    [W:0.596 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site