summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-12-16 21:00:49 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-16 21:00:49 -0200
commita0eaf112882fd10323cb5a701bffffb4e5dfcb7b (patch)
treef04db4b5efd07d84fad1686685ff55084c852222 /linux
parent1e115775994e75b023a2b0a53fecb75bb949cc95 (diff)
downloadmediapointer-dvb-s2-a0eaf112882fd10323cb5a701bffffb4e5dfcb7b.tar.gz
mediapointer-dvb-s2-a0eaf112882fd10323cb5a701bffffb4e5dfcb7b.tar.bz2
em28xx: move dev->lock from res_free to the caller routines
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index ff960f90c..9ac643abb 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -622,10 +622,8 @@ static void res_free(struct em28xx_fh *fh)
{
struct em28xx *dev = fh->dev;
- mutex_lock(&dev->lock);
fh->stream_on = 0;
dev->stream_on = 0;
- mutex_unlock(&dev->lock);
}
/*
@@ -1293,7 +1291,9 @@ static int vidioc_streamoff(struct file *file, void *priv,
return -EINVAL;
videobuf_streamoff(&fh->vb_vidq);
+ mutex_lock(&dev->lock);
res_free(fh);
+ mutex_unlock(&dev->lock);
return 0;
}
@@ -1740,11 +1740,10 @@ static int em28xx_v4l2_close(struct inode *inode, struct file *filp)
em28xx_videodbg("users=%d\n", dev->users);
+ mutex_lock(&dev->lock);
if (res_check(fh))
res_free(fh);
- mutex_lock(&dev->lock);
-
if (dev->users == 1) {
videobuf_stop(&fh->vb_vidq);
videobuf_mmap_free(&fh->vb_vidq);