lkml.org 
[lkml]   [2015]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/9] arm: twr-k70f120m: timer driver for Kinetis SoC
On Tue, 30 Jun 2015, Paul Osmialowski wrote:
> +static struct kinetis_clock_event_ddata
> + kinetis_clockevent_tmrs[KINETIS_PIT_CHANNELS] = {
> + {
> + .evtdev = {
> + .name = "kinetis-clockevent0",
> + .rating = 200,
> + .features =
> + CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
> + .set_next_event = kinetis_clockevent_tmr_set_next_event,
> + .set_state_periodic =
> + kinetis_clockevent_tmr_set_state_periodic,
> + .set_state_oneshot =
> + kinetis_clockevent_tmr_set_state_oneshot,
> + .set_state_oneshot_stopped =
> + kinetis_clockevent_tmr_set_state_oneshot,
> + .set_state_shutdown =
> + kinetis_clockevent_tmr_set_state_oneshot,
> + },
> + },
> + {
> + .evtdev = {
> + .name = "kinetis-clockevent1",
> + },

So how is that supposed to work if timer 1,2 or 3 is selected from
device tree? The function pointers are not initialized.

You really do not need that array at all. You can simply set the name
at init time.

> + clockevents_register_device(
> + &kinetis_clockevent_tmrs[chan].evtdev);
> +
> + kinetis_pit_init(&kinetis_clockevent_tmrs[chan],
> + (rate / HZ) - 1);
> + kinetis_pit_enable(&kinetis_clockevent_tmrs[chan], 1);

No point doing this. The core code has invoked the set_periodic call
back via clockevents_register_device() already.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-07-01 10:01    [W:1.650 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site