Skip to content

Commit

Permalink
rfkill: Add the capability to switch all devices of all type in __rfk…
Browse files Browse the repository at this point in the history
…ill_switch_all().

__rfkill_switch_all() switches the state of devices of a given type; however,
it does not switch devices of all type (RFKILL_TYPE_ALL). As a result, it
ignores the keycode "KEY_RFKILL" from another module, i.e. eeepc-wmi.

This fix is to make __rfkill_switch_all() to be able to switch not only
devices of a given type but also all devices.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Alex Hung authored and John W. Linville committed Jun 6, 2012
1 parent e8c9bd5 commit 27e49ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)

rfkill_global_states[type].cur = blocked;
list_for_each_entry(rfkill, &rfkill_list, node) {
if (rfkill->type != type)
if (rfkill->type != type && type != RFKILL_TYPE_ALL)
continue;

rfkill_set_block(rfkill, blocked);
Expand Down

0 comments on commit 27e49ca

Please sign in to comment.