diff options
author | João Paulo Rechi Vita <jprvita@gmail.com> | 2015-08-25 08:56:43 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-09-04 08:26:56 -0400 |
commit | 4c0778933a3d7c35a94e8c35847acd9bb59a257d (patch) | |
tree | 2fc41561ce6db7b5012675caf4593e51f1837bc1 /net | |
parent | 22f66895e60cfc55b92f6fa93f05bb3fbdbd0bed (diff) |
rfkill: Copy "all" global state to other types
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>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/rfkill/core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index f12149a29cb1..b41e9ea2ffff 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -341,7 +341,15 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked) | |||
341 | { | 341 | { |
342 | struct rfkill *rfkill; | 342 | struct rfkill *rfkill; |
343 | 343 | ||
344 | rfkill_global_states[type].cur = blocked; | 344 | if (type == RFKILL_TYPE_ALL) { |
345 | int i; | ||
346 | |||
347 | for (i = 0; i < NUM_RFKILL_TYPES; i++) | ||
348 | rfkill_global_states[i].cur = blocked; | ||
349 | } else { | ||
350 | rfkill_global_states[type].cur = blocked; | ||
351 | } | ||
352 | |||
345 | list_for_each_entry(rfkill, &rfkill_list, node) { | 353 | list_for_each_entry(rfkill, &rfkill_list, node) { |
346 | if (rfkill->type != type && type != RFKILL_TYPE_ALL) | 354 | if (rfkill->type != type && type != RFKILL_TYPE_ALL) |
347 | continue; | 355 | continue; |