mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 11:03:07 -04:00
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>
This commit is contained in:
committed by
Sakari Ailus
parent
e4a4f2e3b9
commit
3e275097e2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user