From 645f3d38e194fe3beee684f1db8f895df60ad2c2 Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Wed, 2 Jul 2025 10:33:59 +0000 Subject: [PATCH] drivers: video: fix order of fields to allow use with FIFOs The struct video_buffer are currently used with `struct k_fifo`, which require them to preserve the first word of data for use by the kernel. Move the first fields to make it possible to keep using video buffers in FIFO safely. Fixes #92526 Signed-off-by: Josuah Demangeon --- include/zephyr/drivers/video.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/zephyr/drivers/video.h b/include/zephyr/drivers/video.h index 20de3754887..0744219a769 100644 --- a/include/zephyr/drivers/video.h +++ b/include/zephyr/drivers/video.h @@ -144,10 +144,11 @@ struct video_caps { * Represent a video frame. */ struct video_buffer { + /** Pointer to driver specific data. */ + /* It must be kept as first field of the struct if used for @ref k_fifo APIs. */ + void *driver_data; /** type of the buffer */ enum video_buf_type type; - /** pointer to driver specific data. */ - void *driver_data; /** pointer to the start of the buffer. */ uint8_t *buffer; /** index of the buffer, optionally set by the application */