diff options
| author | Laurent Pinchart <[email protected]> | 2024-04-24 23:57:33 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2024-06-26 14:39:34 +0000 |
| commit | 2ef9a1e722688ccea824e5f224b91ab4b6fb1a47 (patch) | |
| tree | c252502b7732ab35b08e5649ad164f5767c868ff /drivers/media/test-drivers/vimc/vimc-sensor.c | |
| parent | Merge tag 'tags/next-media-20240626' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
| download | kernel-2ef9a1e722688ccea824e5f224b91ab4b6fb1a47.tar.gz kernel-2ef9a1e722688ccea824e5f224b91ab4b6fb1a47.zip | |
media: vimc: Don't iterate over single pad
The .init_state() operations of the debayer and sensor entities iterate
over the entity's pads. In practice, the iteration covers a single pad
only. Access the pad directly and remove the loops.
Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Sakari Ailus <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'drivers/media/test-drivers/vimc/vimc-sensor.c')
| -rw-r--r-- | drivers/media/test-drivers/vimc/vimc-sensor.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/media/test-drivers/vimc/vimc-sensor.c b/drivers/media/test-drivers/vimc/vimc-sensor.c index 5e34b1aed95e..b535b3ffecff 100644 --- a/drivers/media/test-drivers/vimc/vimc-sensor.c +++ b/drivers/media/test-drivers/vimc/vimc-sensor.c @@ -44,14 +44,10 @@ static const struct v4l2_mbus_framefmt fmt_default = { static int vimc_sensor_init_state(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state) { - unsigned int i; - - for (i = 0; i < sd->entity.num_pads; i++) { - struct v4l2_mbus_framefmt *mf; + struct v4l2_mbus_framefmt *mf; - mf = v4l2_subdev_state_get_format(sd_state, i); - *mf = fmt_default; - } + mf = v4l2_subdev_state_get_format(sd_state, 0); + *mf = fmt_default; return 0; } |
