aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/hv/osd.c34
-rw-r--r--drivers/staging/hv/osd.h4
2 files changed, 0 insertions, 38 deletions
diff --git a/drivers/staging/hv/osd.c b/drivers/staging/hv/osd.c
index b699ee27f07f..b5a3940331b3 100644
--- a/drivers/staging/hv/osd.c
+++ b/drivers/staging/hv/osd.c
@@ -43,12 +43,6 @@
43#include <linux/slab.h> 43#include <linux/slab.h>
44#include "osd.h" 44#include "osd.h"
45 45
46struct osd_callback_struct {
47 struct work_struct work;
48 void (*callback)(void *);
49 void *data;
50};
51
52void *osd_virtual_alloc_exec(unsigned int size) 46void *osd_virtual_alloc_exec(unsigned int size)
53{ 47{
54#ifdef __x86_64__ 48#ifdef __x86_64__
@@ -198,31 +192,3 @@ int osd_waitevent_waitex(struct osd_waitevent *wait_event, u32 timeout_in_ms)
198 return ret; 192 return ret;
199} 193}
200EXPORT_SYMBOL_GPL(osd_waitevent_waitex); 194EXPORT_SYMBOL_GPL(osd_waitevent_waitex);
201
202static void osd_callback_work(struct work_struct *work)
203{
204 struct osd_callback_struct *cb = container_of(work,
205 struct osd_callback_struct,
206 work);
207 (cb->callback)(cb->data);
208 kfree(cb);
209}
210
211int osd_schedule_callback(struct workqueue_struct *wq,
212 void (*func)(void *),
213 void *data)
214{
215 struct osd_callback_struct *cb;
216
217 cb = kmalloc(sizeof(*cb), GFP_KERNEL);
218 if (!cb) {
219 printk(KERN_ERR "unable to allocate memory in osd_schedule_callback\n");
220 return -1;
221 }
222
223 cb->callback = func;
224 cb->data = data;
225 INIT_WORK(&cb->work, osd_callback_work);
226 return queue_work(wq, &cb->work);
227}
228
diff --git a/drivers/staging/hv/osd.h b/drivers/staging/hv/osd.h
index cae126ff6b9a..870ef0768833 100644
--- a/drivers/staging/hv/osd.h
+++ b/drivers/staging/hv/osd.h
@@ -63,8 +63,4 @@ extern int osd_waitevent_wait(struct osd_waitevent *wait_event);
63extern int osd_waitevent_waitex(struct osd_waitevent *wait_event, 63extern int osd_waitevent_waitex(struct osd_waitevent *wait_event,
64 u32 timeout_in_ms); 64 u32 timeout_in_ms);
65 65
66int osd_schedule_callback(struct workqueue_struct *wq,
67 void (*func)(void *),
68 void *data);
69
70#endif /* _OSD_H_ */ 66#endif /* _OSD_H_ */