Thread (6 messages) 6 messages, 3 authors, 2016-01-07

Re: [PATCH] net/rfkill: Create "airplane mode" LED trigger

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2016-01-06 10:32:10
Also in: linux-wireless, lkml

On Tue, 2016-01-05 at 22:55 -0800, Marcel Holtmann wrote:
so I am not convinced the kernel should have the concept of airplane
mode at all.
[snip long story]

This is true, but that doesn't mean the patch is bad, just the naming
could be different.

I think the patch could name this "rfkill-all" (or so) instead, and
replace all the "airplane_mode" identifiers as well.

Then the driver can still default to "rfkill-all" trigger, or a
suitably interested userspace could remove the trigger and manage the
LED state itself.

Then again - if I think about that more - perhaps the kernel *should*
have a concept of airplane mode, just one that's not necessarily tied
to the "rfkill_all" setting, but could be controlled by userspace. That
way, userspace wouldn't have to know about the LED, just about the
airplane mode indicator (for which rfkill would probably be an
appropriate place)

Two comments on the patch itself:
+#ifdef CONFIG_RFKILL_LEDS
+       led_trigger_register(&amp;airplane_mode_led_trigger);
+#endif
Everything else uses inlines to avoid ifdefs, you can do the same here.
Also, error handling seems necessary.

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