aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/tm6000/tm6000-video.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@avionic-design.de>2011-08-04 04:14:15 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-08-31 17:21:24 -0300
commitaa4a583d3539729d1cbd64cda7a8be078a824df8 (patch)
treefdcfbf30d020280319d7146978c1203b292cbbe5 /drivers/staging/tm6000/tm6000-video.c
parent[media] tm6000: Execute lightweight reset on close (diff)
downloadlinux-dev-aa4a583d3539729d1cbd64cda7a8be078a824df8.tar.xz
linux-dev-aa4a583d3539729d1cbd64cda7a8be078a824df8.zip
[media] tm6000: Do not use video buffers in radio mode
If the radio device is opened there is no need to initialize the video buffer queue because it is not used. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/tm6000/tm6000-video.c')
-rw-r--r--drivers/staging/tm6000/tm6000-video.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c
index df8e25301d2f..1e5ace0b5d10 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1530,13 +1530,13 @@ static int tm6000_open(struct file *file)
dev->mode = TM6000_MODE_ANALOG;
}
- videobuf_queue_vmalloc_init(&fh->vb_vidq, &tm6000_video_qops,
- NULL, &dev->slock,
- fh->type,
- V4L2_FIELD_INTERLACED,
- sizeof(struct tm6000_buffer), fh, &dev->lock);
-
- if (fh->radio) {
+ if (!fh->radio) {
+ videobuf_queue_vmalloc_init(&fh->vb_vidq, &tm6000_video_qops,
+ NULL, &dev->slock,
+ fh->type,
+ V4L2_FIELD_INTERLACED,
+ sizeof(struct tm6000_buffer), fh, &dev->lock);
+ } else {
dprintk(dev, V4L2_DEBUG_OPEN, "video_open: setting radio device\n");
dev->input = 5;
tm6000_set_audio_rinput(dev);
@@ -1608,7 +1608,9 @@ static int tm6000_release(struct file *file)
int err;
tm6000_uninit_isoc(dev);
- videobuf_mmap_free(&fh->vb_vidq);
+
+ if (!fh->radio)
+ videobuf_mmap_free(&fh->vb_vidq);
err = tm6000_reset(dev);
if (err < 0)