Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753266AbbGAHwm (ORCPT ); Wed, 1 Jul 2015 03:52:42 -0400 Received: from www.linutronix.de ([62.245.132.108]:37471 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949AbbGAHwd (ORCPT ); Wed, 1 Jul 2015 03:52:33 -0400 Date: Wed, 1 Jul 2015 09:51:49 +0200 (CEST) From: Thomas Gleixner To: Paul Osmialowski cc: Greg Kroah-Hartman , Ian Campbell , Jiri Slaby , Kumar Gala , Linus Walleij , Mark Rutland , Michael Turquette , Pawel Moll , Rob Herring , Russell King , Stephen Boyd , Vinod Koul , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, Arnd Bergmann , Geert Uytterhoeven , Nicolas Pitre , Paul Bolle , Uwe Kleine-Koenig , Anson Huang , Frank Li , Jingchang Lu , Rob Herring , Yuri Tikhonov , Sergei Poselenov , Alexander Potashev Subject: Re: [PATCH v2 4/9] arm: twr-k70f120m: timer driver for Kinetis SoC In-Reply-To: <1435667250-28299-5-git-send-email-pawelo@king.net.pl> Message-ID: References: <1435667250-28299-1-git-send-email-pawelo@king.net.pl> <1435667250-28299-5-git-send-email-pawelo@king.net.pl> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1581 Lines: 49 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/