bcm27xx: switch to kernel v6.1
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0732-media-i2c-ov7251-Fix-link_freq-validation-loop.patch
1 From fd7067bd245a90d957b70ce8be96b2a4d7b970a6 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 17 Feb 2022 15:57:01 +0000
4 Subject: [PATCH] media: i2c: ov7251: Fix link_freq validation loop
5
6 If only one link frequency was configured, then ov7251_check_hwcfg
7 failed as the conditions weren't checked in the appropriate places.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
10 ---
11 drivers/media/i2c/ov7251.c | 6 +++---
12 1 file changed, 3 insertions(+), 3 deletions(-)
13
14 --- a/drivers/media/i2c/ov7251.c
15 +++ b/drivers/media/i2c/ov7251.c
16 @@ -1390,14 +1390,14 @@ static int ov7251_check_hwcfg(struct ov7
17
18 freq_found = false;
19 for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++) {
20 - if (freq_found)
21 - break;
22 -
23 for (j = 0; j < ARRAY_SIZE(link_freq); j++)
24 if (bus_cfg.link_frequencies[i] == link_freq[j]) {
25 freq_found = true;
26 break;
27 }
28 +
29 + if (freq_found)
30 + break;
31 }
32
33 if (i == bus_cfg.nr_of_link_frequencies) {