Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-09 Thread Arnd Bergmann
On Wednesday 08 October 2014 18:19:52 Thomas Gleixner wrote: > Ok, got it. It does not change the fact that the above function is > butt ugly and completely non intuitive. Agreed, it could at least use a comment to explain the logic behind it. > I also do not agree, that the DT should not tell wh

Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-09 Thread Ley Foon Tan
On Wed, Oct 8, 2014 at 6:44 PM, Thomas Gleixner wrote: > On Wed, 8 Oct 2014, Ley Foon Tan wrote: >> +static void nios2_timer_set_mode(enum clock_event_mode mode, >> + struct clock_event_device *evt) >> +{ >> + unsigned long period; >> + struct nios2_clockevent_dev *nios2_ced = to_nios2

Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-08 Thread Thomas Gleixner
On Wed, 8 Oct 2014, Arnd Bergmann wrote: > On Wednesday 08 October 2014 17:20:44 Thomas Gleixner wrote: > > On Wed, 8 Oct 2014, Arnd Bergmann wrote: > > > On Wednesday 08 October 2014 12:44:32 Thomas Gleixner wrote: > > > > > +static int num_called; > > > > > +static void __init nios2_time_init(str

Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-08 Thread Arnd Bergmann
On Wednesday 08 October 2014 17:20:44 Thomas Gleixner wrote: > On Wed, 8 Oct 2014, Arnd Bergmann wrote: > > On Wednesday 08 October 2014 12:44:32 Thomas Gleixner wrote: > > > > +static int num_called; > > > > +static void __init nios2_time_init(struct device_node *timer) > > > > +{ > > > > + sw

Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-08 Thread Thomas Gleixner
On Wed, 8 Oct 2014, Arnd Bergmann wrote: > On Wednesday 08 October 2014 12:44:32 Thomas Gleixner wrote: > > > +static int num_called; > > > +static void __init nios2_time_init(struct device_node *timer) > > > +{ > > > + switch (num_called) { > > > + case 0: > > > + nios2_clockev

Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-08 Thread Arnd Bergmann
On Wednesday 08 October 2014 12:44:32 Thomas Gleixner wrote: > > +static int num_called; > > +static void __init nios2_time_init(struct device_node *timer) > > +{ > > + switch (num_called) { > > + case 0: > > + nios2_clockevent_init(timer); > > + break; > > + cas

Re: [PATCH v4 21/29] nios2: Time keeping

2014-10-08 Thread Thomas Gleixner
On Wed, 8 Oct 2014, Ley Foon Tan wrote: > +static void nios2_timer_set_mode(enum clock_event_mode mode, > + struct clock_event_device *evt) > +{ > + unsigned long period; > + struct nios2_clockevent_dev *nios2_ced = to_nios2_clkevent(evt); > + struct nios2_timer *timer = &nios2_ced-