summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/vivi.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/vivi.c')
-rw-r--r--linux/drivers/media/video/vivi.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index 12307d4bd..5d29fb09c 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -40,9 +40,7 @@
#include <linux/interrupt.h>
#include <media/videobuf-vmalloc.h>
#include <media/v4l2-common.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
#include <linux/kthread.h>
-#endif
#include <linux/highmem.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
#include <linux/freezer.h>
@@ -161,10 +159,6 @@ struct vivi_dmaqueue {
/* thread for generating video stream*/
struct task_struct *kthread;
wait_queue_head_t wq;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- struct semaphore *notify;
- int rmmod:1;
-#endif
/* Counters to control fps rate */
int frame;
int ini_jiffies;
@@ -446,13 +440,8 @@ static void vivi_sleep(struct vivi_fh *fh)
(unsigned long)dma_q);
add_wait_queue(&dma_q->wq, &wait);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- if ((q->rmmod || signal_pending(current)))
- goto stop_task;
-#else
if (kthread_should_stop())
goto stop_task;
-#endif
/* Calculate time to wake up */
timeout = msecs_to_jiffies(frames_to_ms(1));
@@ -471,20 +460,6 @@ static int vivi_thread(void *data)
struct vivi_fh *fh = data;
struct vivi_dev *dev = fh->dev;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- daemonize();
- exit_files(current);
- reparent_to_init();
-
- spin_lock_irq(SIGMASK_LOCK(current));
- sigfillset(&current->blocked);
- spin_unlock_irq(SIGMASK_LOCK(current));
- strcpy(current->comm, "vivi");
-
- dma_q->kthread = current;
- if (dma_q->notify != NULL)
- up(dma_q->notify);
-#endif
dprintk(dev, 1, "thread started\n");
set_freezable();
@@ -492,20 +467,10 @@ static int vivi_thread(void *data)
for (;;) {
vivi_sleep(fh);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- if (dma_q->rmmod || signal_pending(current))
-#else
if (kthread_should_stop())
-#endif
break;
}
dprintk(dev, 1, "thread: exit\n");
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- dma_q->kthread = NULL;
-
- if (dma_q->notify != NULL)
- up(dma_q->notify);
-#endif
return 0;
}
@@ -519,28 +484,12 @@ static int vivi_start_thread(struct vivi_fh *fh)
dprintk(dev, 1, "%s\n", __func__);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
dma_q->kthread = kthread_run(vivi_thread, fh, "vivi");
if (IS_ERR(dma_q->kthread)) {
printk(KERN_ERR "vivi: kernel_thread() failed\n");
return PTR_ERR(dma_q->kthread);
}
-#else
- DECLARE_MUTEX_LOCKED(sem);
-
- dma_q->kthread = NULL;
- dma_q->notify = &sem;
- dma_q->rmmod = 0;
-
- if (kernel_thread(vivi_thread, fh, 0) < 0) {
- printk(KERN_ERR "sdim: kernel_thread() failed\n");
- return -EINVAL;
- }
-
- down(&sem);
- dma_q->notify = NULL;
-#endif
/* Wakes thread */
wake_up_interruptible(&dma_q->wq);
@@ -555,19 +504,7 @@ static void vivi_stop_thread(struct vivi_dmaqueue *dma_q)
dprintk(dev, 1, "%s\n", __func__);
/* shutdown control thread */
if (dma_q->kthread) {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- DECLARE_MUTEX_LOCKED(sem);
-
- /* shutdown control thread */
- dma_q->notify = &sem;
- dma_q->rmmod = 1;
- if (waitqueue_active(&dma_q->wq))
- wake_up_interruptible(&dma_q->wq);
- down(&sem);
- dma_q->notify = NULL;
-#else
kthread_stop(dma_q->kthread);
-#endif
dma_q->kthread = NULL;
}
}