rt2x00: Only register rfkill input when key is present
authorIvo van Doorn <ivdoorn@gmail.com>
Wed, 7 Jan 2009 13:51:41 +0000 (14:51 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 20:59:57 +0000 (15:59 -0500)
rt2x00 should only register the RFKILL input device when the hardware indicated
the key was present.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00rfkill.c

index 595efd05ce44b0d30516494e2b1a64c67ef5d1f6..53f64b76a8c11988df027aefe807235049b89747 100644 (file)
@@ -87,7 +87,8 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
 {
        struct input_polled_dev *poll_dev;
 
-       if (test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state))
+       if (test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state) ||
+           !test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags))
                return;
 
        poll_dev = input_allocate_polled_device();