aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-06-17 12:36:01 +0200
committerTakashi Iwai <tiwai@suse.de>2011-06-17 12:36:01 +0200
commit3dde2ffcc8d8db76f67a53a839a4f1db97b841fd (patch)
tree3dbafa182cf8d9ab0cc0224dc2f65e63635e3ce4
parent6fa7343c5ce6f9d5c331e7f6a5537e15e81fea35 (diff)
downloadalsa-driver-build-unstable-topic/kill-tasklet.tar.gz
Add wrapper for system-wide workqueuestopic/kill-tasklet
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/adriver.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/adriver.h b/include/adriver.h
index 75440c10b..0ffb00a4c 100644
--- a/include/adriver.h
+++ b/include/adriver.h
@@ -1974,6 +1974,21 @@ static inline bool flush_delayed_work_sync(struct delayed_work *dwork)
#define cancel_work_sync flush_work
#endif
+/* system-wide workqueues */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
+#define system_wq (struct workqueue_struct *)-1L
+#define system_long_wq (struct workqueue_struct *)-1L
+static inline int _snd_queue_work(struct workqueue_struct *wq,
+ struct work_struct *work)
+{
+ if (wq == system_wq || wq == system_long_wq)
+ return schedule_work(work);
+ else
+ return queue_work(wq, work);
+}
+#define queue_work(wq, work) _snd_queue_work(wq, work)
+#endif
+
#endif /* < 2.6.37 */
/* pm_wakeup_event() wrapper */