diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-17 00:00:49 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 12:39:13 +0100 |
commit | 7831364f33af9bb7333f333e9a239b1dd2edea1c (patch) | |
tree | a699ba31bca6f697fbdc35f31ba60a5098085c8d /drivers/media/video/em28xx/em28xx-video.c | |
parent | V4L/DVB (9905): v4l2-compat32: add missing newline after kernel message (diff) | |
download | linux-7831364f33af9bb7333f333e9a239b1dd2edea1c.tar.xz linux-7831364f33af9bb7333f333e9a239b1dd2edea1c.zip |
V4L/DVB (9909): em28xx: move dev->lock from res_free to the caller routines
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 6e558d2ca0f3..90aedaeb09b9 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c @@ -617,10 +617,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); } /* @@ -1282,7 +1280,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; } @@ -1677,11 +1677,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); |