Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
if (!is_present(dev))
return -EIO;
- if (dev->owner && dev->owner != fp)
+ if (dev->owner && (!dev->reading || dev->owner != fp))
return -EBUSY;
dev->owner = fp;
if (!is_streaming(dev)) {
|| stk_allocate_buffers(dev, 3)
|| stk_start_stream(dev))
return -ENOMEM;
+ dev->reading = 1;
spin_lock_irqsave(&dev->spinlock, flags);
for (i = 0; i < dev->n_sbufs; i++) {
list_add_tail(&dev->sio_bufs[i].list, &dev->sio_avail);
int frame_size;
/* Streaming buffers */
+ int reading;
unsigned int n_sbufs;
struct stk_sio_buffer *sio_bufs;
struct list_head sio_avail;