[PATCH v8 32/53] media: mediatek: vcodec: Stop direct calls to queue num_buffers field

Benjamin Gaignard
2023-09-27T15:38:37Z

Use vb2_get_num_buffers() to avoid using queue num_buffer field directly.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c
index 04948d3eb011..8c580956b905 100644
--- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c
@@ -923,7 +923,7 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count)
mtk_v4l2_venc_err(ctx, "pm_runtime_put fail %d", pm_ret);

err_start_stream:
- for (i = 0; i < q->num_buffers; ++i) {
+ for (i = 0; i < q->max_num_buffers; ++i) {
struct vb2_buffer *buf = vb2_get_buffer(q, i);

/*