Skip to content

Commit

Permalink
rfkill: always init poll delayed work
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 3, 2009
1 parent 72828b1 commit 2ec2c68
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions net/rfkill/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2ec2c68

Please sign in to comment.