diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-11-30 15:58:10 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-12-09 09:30:22 +0300 |
commit | 0d75bb6ae127f5e3fd0e2239714908fd2038193d (patch) | |
tree | 7fafa59f6913fd55959cf22e4ba017a6dbdc886c /drivers/media/pci/bt8xx/bttv-driver.c | |
parent | e55a9482888da73eeadde5f13ef8bafce68a38ed (diff) | |
download | linux-0d75bb6ae127f5e3fd0e2239714908fd2038193d.tar.xz |
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>
Diffstat (limited to 'drivers/media/pci/bt8xx/bttv-driver.c')
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-driver.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 09a193bb87df..8e8c9dada67a 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -1536,13 +1536,11 @@ static void buf_cleanup(struct vb2_buffer *vb) static int start_streaming(struct vb2_queue *q, unsigned int count) { - int ret = 1; int seqnr = 0; struct bttv_buffer *buf; struct bttv *btv = vb2_get_drv_priv(q); - ret = check_alloc_btres_lock(btv, RESOURCE_VIDEO_STREAM); - if (ret == 0) { + if (!check_alloc_btres_lock(btv, RESOURCE_VIDEO_STREAM)) { if (btv->field_count) seqnr++; 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_BUF_STATE_QUEUED); } - return !ret; + return -EBUSY; } if (!vb2_is_streaming(&btv->vbiq)) { init_irqreg(btv); |