Skip to content

Commit

Permalink
[media] tm6000: Do not use video buffers in radio mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thierry Reding authored and Mauro Carvalho Chehab committed Aug 31, 2011
1 parent dd0c8ab commit aa4a583
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions drivers/staging/tm6000/tm6000-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit aa4a583

Please sign in to comment.