Skip to contentSkip to conversation

rt2x00: Only register rfkill input when key is present

PATCH New Ivo van Doorn 1 participant 1 message Jan 7, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: Only register rfkill input when key is present

rt2x00 should only register the RFKILL input device when the hardware indicated the key was present.

---

drivers/net/wireless/rt2x00/rt2x00rfkill.c +2 -1
index 5024e3d..0b089ec 100644
@@ -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();