]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/stradis.c
V4L/DVB (8752): s2255drv: firmware improvement patch
[linux-2.6-omap-h63xx.git] / drivers / media / video / stradis.c
index c109511f21ea8a92b307d4ce1596748567c0348f..a3cbe9be3c15e363eab265575505846d78a0d0a2 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/vmalloc.h>
 #include <linux/videodev.h>
 #include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
 
 #include "saa7146.h"
 #include "saa7146reg.h"
@@ -1881,12 +1882,16 @@ static int saa_open(struct inode *inode, struct file *file)
        struct video_device *vdev = video_devdata(file);
        struct saa7146 *saa = container_of(vdev, struct saa7146, video_dev);
 
+       lock_kernel();
        file->private_data = saa;
 
        saa->user++;
-       if (saa->user > 1)
+       if (saa->user > 1) {
+               unlock_kernel();
                return 0;       /* device open already, don't reset */
+       }
        saa->writemode = VID_WRITE_MPEG_VID;    /* default to video */
+       unlock_kernel();
        return 0;
 }
 
@@ -1918,7 +1923,6 @@ static const struct file_operations saa_fops = {
 /* template for video_device-structure */
 static struct video_device saa_template = {
        .name = "SAA7146A",
-       .type = VID_TYPE_CAPTURE | VID_TYPE_OVERLAY,
        .fops = &saa_fops,
        .minor = -1,
 };