public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rfkill: always init poll delayed work
@ 2009-06-03  7:55 Johannes Berg
  2009-06-03 14:50 ` Larry Finger
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Berg @ 2009-06-03  7:55 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Larry Finger

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>
---
 net/rfkill/core.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

--- wireless-testing.orig/net/rfkill/core.c	2009-06-03 09:52:39.000000000 +0200
+++ wireless-testing/net/rfkill/core.c	2009-06-03 09:53:03.000000000 +0200
@@ -909,16 +909,15 @@ int __must_check rfkill_register(struct 
 
 	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);



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-06-05 13:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03  7:55 [PATCH] rfkill: always init poll delayed work Johannes Berg
2009-06-03 14:50 ` Larry Finger
2009-06-03 14:55   ` Johannes Berg
2009-06-04 14:52     ` Larry Finger
2009-06-04 15:12       ` Johannes Berg
2009-06-04 15:59         ` Larry Finger
2009-06-04 16:19           ` Johannes Berg
2009-06-04 16:28             ` Larry Finger
2009-06-04 16:31               ` Johannes Berg
2009-06-04 16:51                 ` Larry Finger
2009-06-04 16:57                   ` Johannes Berg
2009-06-04 17:52                     ` Larry Finger
2009-06-04 18:02                       ` Johannes Berg
2009-06-05 13:03                         ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox