Commit 5b5d13af authored by Gertjan van Wingerde's avatar Gertjan van Wingerde Committed by John W. Linville
Browse files

rt2x00: Fix rfkill structure initialization to prevent rfkill WARN_ON.

The state field of the rfkill structure was incorrectly initialized to -1, which results in rfkill
issueing a WARN_ON. Fix this by initializing the state field to the proper value as indicated by
the driver.
Signed-off-by: default avatarGertjan van Wingerde <>
Signed-off-by: default avatarIvo van Doorn <>
Signed-off-by: default avatarJohn W. Linville <>
parent f74b6a54
...@@ -145,10 +145,15 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) ...@@ -145,10 +145,15 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
rt2x00dev->rfkill->name = rt2x00dev->ops->name; rt2x00dev->rfkill->name = rt2x00dev->ops->name;
rt2x00dev->rfkill->data = rt2x00dev; rt2x00dev->rfkill->data = rt2x00dev;
rt2x00dev->rfkill->state = -1;
rt2x00dev->rfkill->toggle_radio = rt2x00rfkill_toggle_radio; rt2x00dev->rfkill->toggle_radio = rt2x00rfkill_toggle_radio;
if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) {
rt2x00dev->rfkill->get_state = rt2x00rfkill_get_state; rt2x00dev->rfkill->get_state = rt2x00rfkill_get_state;
rt2x00dev->rfkill->state =
rt2x00dev->ops->lib->rfkill_poll(rt2x00dev) ?
} else {
rt2x00dev->rfkill->state = RFKILL_STATE_UNBLOCKED;
INIT_DELAYED_WORK(&rt2x00dev->rfkill_work, rt2x00rfkill_poll); INIT_DELAYED_WORK(&rt2x00dev->rfkill_work, rt2x00rfkill_poll);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment