summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Mugnier <benjamin.mugnier@foss.st.com>2026-06-29 12:51:47 +0200
committerSakari Ailus <sakari.ailus@linux.intel.com>2026-07-15 11:13:57 +0300
commit3e275097e206a67f2b691c8167313871ee421cd7 (patch)
tree61cc2b1f07e3cae8e77012408d3e5e1b1d962f47
parente4a4f2e3b9bc65e0b82ae8c3a2945955870df36f (diff)
media: i2c: vd55g1: Remove spurious pad format update on init_state()
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. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
-rw-r--r--drivers/media/i2c/vd55g1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/i2c/vd55g1.c b/drivers/media/i2c/vd55g1.c
index fceb437e19be..22464fe31562 100644
--- a/drivers/media/i2c/vd55g1.c
+++ b/drivers/media/i2c/vd55g1.c
@@ -1365,9 +1365,9 @@ static int vd55g1_init_state(struct v4l2_subdev *sd,
code = vd55g1_mbus_formats_mono[0];
else
code = vd55g1_mbus_formats_bayer[0][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);
}