mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
media: bttv: start_streaming should return a proper error code
The start_streaming callback returned 0 or 1 instead of a proper error code. Fix that. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: b7ec3212a73a ("media: bttv: convert to vb2") Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
@@ -1536,13 +1536,11 @@ static void buf_cleanup(struct vb2_buffer *vb)
|
|||||||
|
|
||||||
static int start_streaming(struct vb2_queue *q, unsigned int count)
|
static int start_streaming(struct vb2_queue *q, unsigned int count)
|
||||||
{
|
{
|
||||||
int ret = 1;
|
|
||||||
int seqnr = 0;
|
int seqnr = 0;
|
||||||
struct bttv_buffer *buf;
|
struct bttv_buffer *buf;
|
||||||
struct bttv *btv = vb2_get_drv_priv(q);
|
struct bttv *btv = vb2_get_drv_priv(q);
|
||||||
|
|
||||||
ret = check_alloc_btres_lock(btv, RESOURCE_VIDEO_STREAM);
|
if (!check_alloc_btres_lock(btv, RESOURCE_VIDEO_STREAM)) {
|
||||||
if (ret == 0) {
|
|
||||||
if (btv->field_count)
|
if (btv->field_count)
|
||||||
seqnr++;
|
seqnr++;
|
||||||
while (!list_empty(&btv->capture)) {
|
while (!list_empty(&btv->capture)) {
|
||||||
@@ -1553,7 +1551,7 @@ static int start_streaming(struct vb2_queue *q, unsigned int count)
|
|||||||
vb2_buffer_done(&buf->vbuf.vb2_buf,
|
vb2_buffer_done(&buf->vbuf.vb2_buf,
|
||||||
VB2_BUF_STATE_QUEUED);
|
VB2_BUF_STATE_QUEUED);
|
||||||
}
|
}
|
||||||
return !ret;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
if (!vb2_is_streaming(&btv->vbiq)) {
|
if (!vb2_is_streaming(&btv->vbiq)) {
|
||||||
init_irqreg(btv);
|
init_irqreg(btv);
|
||||||
|
@@ -123,14 +123,12 @@ static void buf_cleanup_vbi(struct vb2_buffer *vb)
|
|||||||
|
|
||||||
static int start_streaming_vbi(struct vb2_queue *q, unsigned int count)
|
static int start_streaming_vbi(struct vb2_queue *q, unsigned int count)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
int seqnr = 0;
|
int seqnr = 0;
|
||||||
struct bttv_buffer *buf;
|
struct bttv_buffer *buf;
|
||||||
struct bttv *btv = vb2_get_drv_priv(q);
|
struct bttv *btv = vb2_get_drv_priv(q);
|
||||||
|
|
||||||
btv->framedrop = 0;
|
btv->framedrop = 0;
|
||||||
ret = check_alloc_btres_lock(btv, RESOURCE_VBI);
|
if (!check_alloc_btres_lock(btv, RESOURCE_VBI)) {
|
||||||
if (ret == 0) {
|
|
||||||
if (btv->field_count)
|
if (btv->field_count)
|
||||||
seqnr++;
|
seqnr++;
|
||||||
while (!list_empty(&btv->vcapture)) {
|
while (!list_empty(&btv->vcapture)) {
|
||||||
@@ -141,13 +139,13 @@ static int start_streaming_vbi(struct vb2_queue *q, unsigned int count)
|
|||||||
vb2_buffer_done(&buf->vbuf.vb2_buf,
|
vb2_buffer_done(&buf->vbuf.vb2_buf,
|
||||||
VB2_BUF_STATE_QUEUED);
|
VB2_BUF_STATE_QUEUED);
|
||||||
}
|
}
|
||||||
return !ret;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
if (!vb2_is_streaming(&btv->capq)) {
|
if (!vb2_is_streaming(&btv->capq)) {
|
||||||
init_irqreg(btv);
|
init_irqreg(btv);
|
||||||
btv->field_count = 0;
|
btv->field_count = 0;
|
||||||
}
|
}
|
||||||
return !ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stop_streaming_vbi(struct vb2_queue *q)
|
static void stop_streaming_vbi(struct vb2_queue *q)
|
||||||
|
Reference in New Issue
Block a user