Thread (3 messages) read the whole thread 3 messages, 2 authors, 2014-08-26

Re: [PATCHv2][input-led] Defer input led work to workqueue

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2014-08-26 13:22:53
Also in: linux-leds, lkml

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help