summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2023-02-22 23:12:47 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 17:10:10 +0200
commit1e293874fabf41fb34d58e22153766fd2bf8c6aa (patch)
treeef52428aa9cecae0eff03a8b02b5802ba4c4a801 /drivers/media/i2c
parentmedia: camss: sm8250: Pipeline starting and stopping for multiple virtual cha... (diff)
downloadlinux-1e293874fabf41fb34d58e22153766fd2bf8c6aa.tar.xz
linux-1e293874fabf41fb34d58e22153766fd2bf8c6aa.zip
media: i2c: adv748x: Fix lookup of DV timings
The loop to match the requested timings with the ones supported by the driver is incorrect. It always iterates thru the whole array of supported modes. The bounds check after the loop always triggers resulting in adv748x_hdmi_set_video_timings() always returning -EINVAL. Fix this by correcting the lookup to break the loop when a match is found. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/adv748x/adv748x-hdmi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c
index 52fa7bd75660..1d62e05572cd 100644
--- a/drivers/media/i2c/adv748x/adv748x-hdmi.c
+++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c
@@ -176,9 +176,9 @@ static int adv748x_hdmi_set_video_timings(struct adv748x_state *state,
unsigned int i;
for (i = 0; i < ARRAY_SIZE(adv748x_hdmi_video_standards); i++) {
- if (!v4l2_match_dv_timings(timings, &stds[i].timings, 250000,
- false))
- continue;
+ if (v4l2_match_dv_timings(timings, &stds[i].timings, 250000,
+ false))
+ break;
}
if (i >= ARRAY_SIZE(adv748x_hdmi_video_standards))