summaryrefslogtreecommitdiff
path: root/net/rfkill
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-03 09:55:29 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:06:15 -0400
commit2ec2c68c11af95075f29e370970eb97c89234e2e (patch)
treedd0749b38d54f41f1823a992815971b02b3e489f /net/rfkill
parent72828b1b3cabecfce4321877aa526a2bd21acf0c (diff)
downloadlinux-next-2ec2c68c11af95075f29e370970eb97c89234e2e.tar.gz
rfkill: always init poll delayed work
The rfkill core didn't initialise the poll delayed work because it assumed that polling was always done by specifying the poll function. cfg80211, however, would like to start polling only later, which is a valid use case and easy to support, so change rfkill to always initialise the poll delayed work and thus allow starting polling by calling the rfkill_resume_polling() function after registration. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/core.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 91e9168b5447..11b7314723df 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -909,16 +909,15 @@ int __must_check rfkill_register(struct rfkill *rfkill)
rfkill->registered = true;
- if (rfkill->ops->poll) {
- INIT_DELAYED_WORK(&rfkill->poll_work, rfkill_poll);
- schedule_delayed_work(&rfkill->poll_work,
- round_jiffies_relative(POLL_INTERVAL));
- }
-
+ INIT_DELAYED_WORK(&rfkill->poll_work, rfkill_poll);
INIT_WORK(&rfkill->uevent_work, rfkill_uevent_work);
-
INIT_WORK(&rfkill->sync_work, rfkill_sync_work);
+
+ if (rfkill->ops->poll)
+ schedule_delayed_work(&rfkill->poll_work,
+ round_jiffies_relative(POLL_INTERVAL));
schedule_work(&rfkill->sync_work);
+
rfkill_send_events(rfkill, RFKILL_OP_ADD);
mutex_unlock(&rfkill_global_mutex);