Return-path: Received: from s3.sipsolutions.net ([5.9.151.49]:40401 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757639AbaHZNWw (ORCPT ); Tue, 26 Aug 2014 09:22:52 -0400 Message-ID: <1409059327.22232.0.camel@jlt4.sipsolutions.net> (sfid-20140826_152312_557533_25007BEF) Subject: Re: [PATCHv2][input-led] Defer input led work to workqueue From: Johannes Berg To: Samuel Thibault Cc: Hugh Dickins , akpm@linux-foundation.org, Sabrina Dubroca , Valdis.Kletnieks@vt.edu, Vincent Donnefort , Bryan Wu , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org Date: Tue, 26 Aug 2014 15:22:07 +0200 In-Reply-To: <20140826091725.GA23293@type.youpi.perso.aquilenet.fr> (sfid-20140826_111735_723896_6D594EC0) References: <20140826015453.GA5235@type.youpi.perso.aquilenet.fr> <20140826091725.GA23293@type.youpi.perso.aquilenet.fr> (sfid-20140826_111735_723896_6D594EC0) Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 2014-08-26 at 11:17 +0200, Samuel Thibault wrote: > - led_trigger_event(&vt_led_triggers[led], !!brightness); > + vt_led_state[led] = !!brightness; > + schedule_work(&vt_led_work[led]); > +static int __init input_led_init(void) > +{ > + unsigned i; > + > + for (i = 0; i < LED_CNT; i++) > + INIT_WORK(&vt_led_work[i], vt_led_cb); > + > + return 0; > +} > + > +static void __exit input_led_exit(void) > +{ > +} Come to think of it - don't you need to cancel_work_sync() in exit so the work struct can't be queued while the module is being unloaded? johannes