summaryrefslogtreecommitdiffstats
path: root/net/rfkill
diff options
context:
space:
mode:
authorJonathan McDowell <noodles@earth.li>2008-10-30 22:46:48 +0000
committerJohn W. Linville <linville@tuxdriver.com>2008-11-06 16:37:09 -0500
commit4a9d916717de0aab4313d43817164577255242fb (patch)
tree504d7b6df2e0998eb2f4df3c6e4a1939d97b1598 /net/rfkill
parent964d2777438bf7687324243d38ade538d9bbfe3c (diff)
downloadlinux-stable-4a9d916717de0aab4313d43817164577255242fb.tar.gz
linux-stable-4a9d916717de0aab4313d43817164577255242fb.tar.bz2
linux-stable-4a9d916717de0aab4313d43817164577255242fb.zip
Fix logic error in rfkill_check_duplicity
> I'll have a prod at why the [hso] rfkill stuff isn't working next Ok, I believe this is due to the addition of rfkill_check_duplicity in rfkill and the fact that test_bit actually returns a negative value rather than the postive one expected (which is of course equally true). So when the second WLAN device (the hso device, with the EEE PC WLAN being the first) comes along rfkill_check_duplicity returns a negative value and so rfkill_register returns an error. Patch below fixes this for me. Signed-Off-By: Jonathan McDowell <noodles@earth.li> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/rfkill.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index f949a482b007..25ba3bd57e66 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -603,7 +603,7 @@ static int rfkill_check_duplicity(const struct rfkill *rfkill)
}
/* 0: first switch of its kind */
- return test_bit(rfkill->type, seen);
+ return (test_bit(rfkill->type, seen)) ? 1 : 0;
}
static int rfkill_add_switch(struct rfkill *rfkill)