[PATCH 2/5] media: i2c: vd55g1: Remove spurious pad format update on init_state()

From: Benjamin Mugnier

Date: Tue Apr 28 2026 - 04:42:12 EST


vd55g1_update_pad_fmt() is called in vd55g1_init_state(). But
vd55g1_set_pad_fmt(), called at the end of vd55g1_init_state(), also
calls vd55g1_update_pad_fmt() itself.

Enhance readability and clear confusion by only preparing the format in
vd55g1_init_state() and let vd55g1_set_pad_fmt() update it instead,
effectively calling it only 1 time instead of 2.

Fixes: e138e7f00042 ("media: i2c: vd55g1: Add support for vd65g4 RGB variant")

Signed-off-by: Benjamin Mugnier <benjamin.mugnier@xxxxxxxxxxx>
---
drivers/media/i2c/vd55g1.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index 1e9db21322e3..e44174056ace 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -1366,9 +1366,9 @@ static int vd55g1_init_state(struct v4l2_subdev *sd,
code = vd55g1_mbus_formats_mono[VD55G1_MBUS_CODE_IDX_DEF];
else
code = vd55g1_mbus_formats_bayer[VD55G1_MBUS_CODE_IDX_DEF][0];
- vd55g1_update_pad_fmt(sensor,
- &vd55g1_supported_modes[VD55G1_MODE_IDX_DEF],
- vd55g1_get_fmt_code(sensor, code), &fmt.format);
+ fmt.format.code = vd55g1_get_fmt_code(sensor, code);
+ fmt.format.width = vd55g1_supported_modes[VD55G1_MODE_IDX_DEF].width;
+ fmt.format.height = vd55g1_supported_modes[VD55G1_MODE_IDX_DEF].height;

return vd55g1_set_pad_fmt(sd, sd_state, &fmt);
}

--
2.43.0