Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] compat: add __cancel_delayed_work()
@ 2012-01-21 13:44 Hauke Mehrtens
  2012-01-23 17:31 ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Hauke Mehrtens @ 2012-01-21 13:44 UTC (permalink / raw)
  To: mcgrof, mcgrof; +Cc: linux-wireless, Hauke Mehrtens

__cancel_delayed_work is needed by include/net/bluetooth/l2cap.h and
not available in old kernel versions. This was just copied from the
kernel.

This should also go into compat-wireless-stable-3.3.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.31.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.31.h b/include/linux/compat-2.6.31.h
index 25db973..a1244cb 100644
--- a/include/linux/compat-2.6.31.h
+++ b/include/linux/compat-2.6.31.h
@@ -215,6 +215,20 @@ extern long long atomic64_add_return(long long a, atomic64_t *v);
 
 #endif
 
+/*
+ * Like above, but uses del_timer() instead of del_timer_sync(). This means,
+ * if it returns 0 the timer function may be running and the queueing is in
+ * progress.
+ */
+static inline bool __cancel_delayed_work(struct delayed_work *work)
+{
+	bool ret;
+
+	ret = del_timer(&work->timer);
+	if (ret)
+		work_clear_pending(&work->work);
+	return ret;
+}
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
 
-- 
1.7.5.4


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

end of thread, other threads:[~2012-02-01 19:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-21 13:44 [PATCH] compat: add __cancel_delayed_work() Hauke Mehrtens
2012-01-23 17:31 ` Luis R. Rodriguez
2012-01-23 17:55   ` Andreas Hartmann
2012-01-23 17:57     ` Luis R. Rodriguez
2012-01-23 18:01       ` Hauke Mehrtens
2012-01-23 18:23         ` Andreas Hartmann
2012-01-23 18:26         ` Luis R. Rodriguez
2012-02-01 19:14   ` Hauke Mehrtens

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