Commit 053fcb60 authored by Brandon Philips's avatar Brandon Philips Committed by Mauro Carvalho Chehab

V4L/DVB (6602): V4L: Convert videobuf drivers to videobuf_stop

Drivers were using cookie cutter code for stopping the read/stream.  Use the
new videobuf_stop function which is lock safe.
Signed-off-by: default avatarBrandon Philips <bphilips@suse.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 19bc5133
...@@ -3827,10 +3827,7 @@ static int bttv_release(struct inode *inode, struct file *file) ...@@ -3827,10 +3827,7 @@ static int bttv_release(struct inode *inode, struct file *file)
/* stop vbi capture */ /* stop vbi capture */
if (check_btres(fh, RESOURCE_VBI)) { if (check_btres(fh, RESOURCE_VBI)) {
if (fh->vbi.streaming) videobuf_stop(&fh->vbi);
videobuf_streamoff(&fh->vbi);
if (fh->vbi.reading)
videobuf_read_stop(&fh->vbi);
free_btres(btv,fh,RESOURCE_VBI); free_btres(btv,fh,RESOURCE_VBI);
} }
......
...@@ -1085,10 +1085,7 @@ static int mpeg_release(struct inode *inode, struct file *file) ...@@ -1085,10 +1085,7 @@ static int mpeg_release(struct inode *inode, struct file *file)
cx8802_cancel_buffers(fh->dev); cx8802_cancel_buffers(fh->dev);
/* stop mpeg capture */ /* stop mpeg capture */
if (fh->mpegq.streaming) videobuf_stop(&fh->mpegq);
videobuf_streamoff(&fh->mpegq);
if (fh->mpegq.reading)
videobuf_read_stop(&fh->mpegq);
videobuf_mmap_free(&fh->mpegq); videobuf_mmap_free(&fh->mpegq);
file->private_data = NULL; file->private_data = NULL;
......
...@@ -851,10 +851,7 @@ static int video_release(struct inode *inode, struct file *file) ...@@ -851,10 +851,7 @@ static int video_release(struct inode *inode, struct file *file)
/* stop vbi capture */ /* stop vbi capture */
if (res_check(fh, RESOURCE_VBI)) { if (res_check(fh, RESOURCE_VBI)) {
if (fh->vbiq.streaming) videobuf_stop(&fh->vbiq);
videobuf_streamoff(&fh->vbiq);
if (fh->vbiq.reading)
videobuf_read_stop(&fh->vbiq);
res_free(dev,fh,RESOURCE_VBI); res_free(dev,fh,RESOURCE_VBI);
} }
......
...@@ -110,11 +110,8 @@ static int ts_release(struct inode *inode, struct file *file) ...@@ -110,11 +110,8 @@ static int ts_release(struct inode *inode, struct file *file)
{ {
struct saa7134_dev *dev = file->private_data; struct saa7134_dev *dev = file->private_data;
if (dev->empress_tsq.streaming)
videobuf_streamoff(&dev->empress_tsq);
mutex_lock(&dev->empress_tsq.lock); mutex_lock(&dev->empress_tsq.lock);
if (dev->empress_tsq.reading) videobuf_stop(&dev->empress_tsq);
videobuf_read_stop(&dev->empress_tsq);
videobuf_mmap_free(&dev->empress_tsq); videobuf_mmap_free(&dev->empress_tsq);
dev->empress_users--; dev->empress_users--;
......
...@@ -1445,10 +1445,7 @@ static int video_release(struct inode *inode, struct file *file) ...@@ -1445,10 +1445,7 @@ static int video_release(struct inode *inode, struct file *file)
/* stop vbi capture */ /* stop vbi capture */
if (res_check(fh, RESOURCE_VBI)) { if (res_check(fh, RESOURCE_VBI)) {
if (fh->vbi.streaming) videobuf_stop(&fh->vbi);
videobuf_streamoff(&fh->vbi);
if (fh->vbi.reading)
videobuf_read_stop(&fh->vbi);
res_free(dev,fh,RESOURCE_VBI); res_free(dev,fh,RESOURCE_VBI);
} }
......
...@@ -1076,6 +1076,7 @@ static int vivi_release(struct inode *inode, struct file *file) ...@@ -1076,6 +1076,7 @@ static int vivi_release(struct inode *inode, struct file *file)
int minor = iminor(inode); int minor = iminor(inode);
vivi_stop_thread(vidq); vivi_stop_thread(vidq);
videobuf_stop(&fh->vb_vidq);
videobuf_mmap_free(&fh->vb_vidq); videobuf_mmap_free(&fh->vb_vidq);
kfree (fh); kfree (fh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment