summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/stradis.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/stradis.c')
-rw-r--r--linux/drivers/media/video/stradis.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux/drivers/media/video/stradis.c b/linux/drivers/media/video/stradis.c
index 7f46a1d64..a081307c7 100644
--- a/linux/drivers/media/video/stradis.c
+++ b/linux/drivers/media/video/stradis.c
@@ -1887,12 +1887,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;
}
@@ -1924,7 +1928,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,
};