summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/vivi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index e6f7d0fe1..30f70c0a1 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -594,7 +594,6 @@ static int vivi_start_thread(struct vivi_dmaqueue *dma_q)
dma_q->ini_jiffies=jiffies;
dprintk(1,"%s\n",__FUNCTION__);
- init_waitqueue_head(&dma_q->wq);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
dma_q->kthread = kthread_run(vivi_thread, dma_q, "vivi");
@@ -628,7 +627,8 @@ static void vivi_stop_thread(struct vivi_dmaqueue *dma_q)
/* shutdown control thread */
dma_q->notify = &sem;
dma_q->rmmod = 1;
- wake_up_interruptible(&dma_q->wq);
+ if (waitqueue_active(&dma_q->wq))
+ wake_up_interruptible(&dma_q->wq);
down(&sem);
dma_q->notify = NULL;
#else
@@ -1436,6 +1436,7 @@ static int __init vivi_init(void)
/* init video dma queues */
INIT_LIST_HEAD(&dev->vidq.active);
INIT_LIST_HEAD(&dev->vidq.queued);
+ init_waitqueue_head(&dev->vidq.wq);
/* initialize locks */
init_MUTEX(&dev->lock);