linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rfkill: Add the capability to switch all devices of all type in __rfkill_switch_all().
@ 2012-05-23  6:11 Alex Hung
  0 siblings, 0 replies; only message in thread
From: Alex Hung @ 2012-05-23  6:11 UTC (permalink / raw)
  To: linville, johannes, davem, linux-wireless, netdev, linux-kernel,
	alex.hung

__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>
---
 net/rfkill/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 5be1957..84dd71a 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -324,7 +324,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);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-23  6:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23  6:11 [PATCH] rfkill: Add the capability to switch all devices of all type in __rfkill_switch_all() Alex Hung

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).