media: i2c: adv748x: Fix lookup of DV timings
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 22 Feb 2023 22:12:47 +0000 (23:12 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 11 Apr 2023 15:10:10 +0000 (17:10 +0200)
commit1e293874fabf41fb34d58e22153766fd2bf8c6aa
treeef52428aa9cecae0eff03a8b02b5802ba4c4a801
parent89013969e23247661f0514c77f26d60fa083216c
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>
drivers/media/i2c/adv748x/adv748x-hdmi.c