summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/allegro-dvt/allegro-mail.c
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-07-13 16:42:21 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-07-19 14:00:31 +0200
commit53c200ff49636de598b2ef5689d548c774b0373a (patch)
tree3d251a0b2b1e10a9aa6e7e445ab13cd32c07201e /drivers/staging/media/allegro-dvt/allegro-mail.c
parent3de16839669f60b6049734e3a9f553a2a958c4b5 (diff)
downloadlinux-53c200ff49636de598b2ef5689d548c774b0373a.tar.bz2
media: allegro: add field for number of buffers
When pushing the buffers for the intermediate and reference frames to the MCU, the driver relied on the message size to calculate the number of buffers. As it is not necessary anymore to keep the messages binary compatible to the firmware, we can just explicitly write the number of buffers into the message. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/allegro-dvt/allegro-mail.c')
-rw-r--r--drivers/staging/media/allegro-dvt/allegro-mail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/allegro-dvt/allegro-mail.c b/drivers/staging/media/allegro-dvt/allegro-mail.c
index c78367d36e2e..ba1c3bc587c6 100644
--- a/drivers/staging/media/allegro-dvt/allegro-mail.c
+++ b/drivers/staging/media/allegro-dvt/allegro-mail.c
@@ -156,7 +156,7 @@ allegro_enc_push_buffers(u32 *dst, struct mcu_msg_push_buffers_internal *msg)
{
unsigned int i = 0;
struct mcu_msg_push_buffers_internal_buffer *buffer;
- unsigned int num_buffers = (msg->header.length - 4) / sizeof(*buffer);
+ unsigned int num_buffers = msg->num_buffers;
unsigned int j;
dst[i++] = msg->channel_id;