linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rfkill: Copy "all" global state to other types
@ 2015-08-24 16:01 João Paulo Rechi Vita
  2015-08-25  0:28 ` Joe Perches
  0 siblings, 1 reply; 10+ messages in thread
From: João Paulo Rechi Vita @ 2015-08-24 16:01 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: João Paulo Rechi Vita

When switching the state of all RFKill switches of type all we need to
replicate the RFKILL_TYPE_ALL global state to all the other types global
state, so it is used to initialize persistent RFKill switches on
register.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
---
 net/rfkill/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index f12149a..1626e26 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -341,7 +341,14 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)
 {
 	struct rfkill *rfkill;
 
-	rfkill_global_states[type].cur = blocked;
+	if (type == RFKILL_TYPE_ALL) {
+		enum rfkill_type i;
+		for (i = 0; i < NUM_RFKILL_TYPES; i++)
+			rfkill_global_states[i].cur = blocked;
+	} else {
+		rfkill_global_states[type].cur = blocked;
+	}
+
 	list_for_each_entry(rfkill, &rfkill_list, node) {
 		if (rfkill->type != type && type != RFKILL_TYPE_ALL)
 			continue;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-09-04 12:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 16:01 [PATCH] rfkill: Copy "all" global state to other types João Paulo Rechi Vita
2015-08-25  0:28 ` Joe Perches
2015-08-25  0:44   ` João Paulo Rechi Vita
2015-08-25 12:56   ` João Paulo Rechi Vita
2015-08-25 16:13     ` Marcel Holtmann
2015-09-01 20:25       ` João Paulo Rechi Vita
2015-09-02 17:42         ` Marcel Holtmann
2015-09-02 18:28           ` Johannes Berg
2015-09-02 18:35             ` João Paulo Rechi Vita
2015-09-04 12:28     ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).