mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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>
This commit is contained in:
parent
22f66895e6
commit
4c0778933a
1 changed files with 9 additions and 1 deletions
|
@ -341,7 +341,15 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)
|
||||||
{
|
{
|
||||||
struct rfkill *rfkill;
|
struct rfkill *rfkill;
|
||||||
|
|
||||||
|
if (type == RFKILL_TYPE_ALL) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < NUM_RFKILL_TYPES; i++)
|
||||||
|
rfkill_global_states[i].cur = blocked;
|
||||||
|
} else {
|
||||||
rfkill_global_states[type].cur = blocked;
|
rfkill_global_states[type].cur = blocked;
|
||||||
|
}
|
||||||
|
|
||||||
list_for_each_entry(rfkill, &rfkill_list, node) {
|
list_for_each_entry(rfkill, &rfkill_list, node) {
|
||||||
if (rfkill->type != type && type != RFKILL_TYPE_ALL)
|
if (rfkill->type != type && type != RFKILL_TYPE_ALL)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue