diff options
author | Gertjan van Wingerde <gwingerde@kpnplanet.nl> | 2008-10-03 14:20:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-06 18:14:57 -0400 |
commit | 5b5d13afeeee959a74114b73c560d3e243f34a11 (patch) | |
tree | 34f9a9ea3eb6520ac41b5ea69990e76901ed8860 /drivers/net/wireless/rt2x00/rt2x00rfkill.c | |
parent | f74b6a5498049bab28419a03e4b31fcdbe7a900d (diff) |
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: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00rfkill.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00rfkill.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c b/drivers/net/wireless/rt2x00/rt2x00rfkill.c index 55eff58f1889..c3f53a92180a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c +++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c | |||
@@ -145,10 +145,15 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) | |||
145 | 145 | ||
146 | rt2x00dev->rfkill->name = rt2x00dev->ops->name; | 146 | rt2x00dev->rfkill->name = rt2x00dev->ops->name; |
147 | rt2x00dev->rfkill->data = rt2x00dev; | 147 | rt2x00dev->rfkill->data = rt2x00dev; |
148 | rt2x00dev->rfkill->state = -1; | ||
149 | rt2x00dev->rfkill->toggle_radio = rt2x00rfkill_toggle_radio; | 148 | rt2x00dev->rfkill->toggle_radio = rt2x00rfkill_toggle_radio; |
150 | if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) | 149 | if (test_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags)) { |
151 | rt2x00dev->rfkill->get_state = rt2x00rfkill_get_state; | 150 | rt2x00dev->rfkill->get_state = rt2x00rfkill_get_state; |
151 | rt2x00dev->rfkill->state = | ||
152 | rt2x00dev->ops->lib->rfkill_poll(rt2x00dev) ? | ||
153 | RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED; | ||
154 | } else { | ||
155 | rt2x00dev->rfkill->state = RFKILL_STATE_UNBLOCKED; | ||
156 | } | ||
152 | 157 | ||
153 | INIT_DELAYED_WORK(&rt2x00dev->rfkill_work, rt2x00rfkill_poll); | 158 | INIT_DELAYED_WORK(&rt2x00dev->rfkill_work, rt2x00rfkill_poll); |
154 | 159 | ||