ALSA: dice: fix kernel NULL pointer dereference due to invalid calculation for array...
[linux/fpc-iii.git] / drivers / edac / wq.c
blob2a9a11ae246156c7ccef414e5a50ea2b33867325
1 #include "edac_module.h"
3 static struct workqueue_struct *wq;
5 bool edac_queue_work(struct delayed_work *work, unsigned long delay)
7 return queue_delayed_work(wq, work, delay);
9 EXPORT_SYMBOL_GPL(edac_queue_work);
11 bool edac_mod_work(struct delayed_work *work, unsigned long delay)
13 return mod_delayed_work(wq, work, delay);
15 EXPORT_SYMBOL_GPL(edac_mod_work);
17 bool edac_stop_work(struct delayed_work *work)
19 bool ret;
21 ret = cancel_delayed_work_sync(work);
22 flush_workqueue(wq);
24 return ret;
26 EXPORT_SYMBOL_GPL(edac_stop_work);
28 int edac_workqueue_setup(void)
30 wq = alloc_ordered_workqueue("edac-poller", WQ_MEM_RECLAIM);
31 if (!wq)
32 return -ENODEV;
33 else
34 return 0;
37 void edac_workqueue_teardown(void)
39 flush_workqueue(wq);
40 destroy_workqueue(wq);
41 wq = NULL;