Skip to content

Commit

Permalink
Merge pull request #240 from jwrdegoede/ov2740-link-freq-fix
Browse files Browse the repository at this point in the history
ov2740: Fix link-frequency check
  • Loading branch information
hao-yao authored Jun 21, 2024
2 parents f80d781 + 1d2e59b commit d7bbd9d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/media/i2c/ov2740.c
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ static int ov2740_check_hwcfg(struct device *dev)
struct v4l2_fwnode_endpoint bus_cfg = {
.bus_type = V4L2_MBUS_CSI2_DPHY
};
bool found = false;
u32 mclk;
int ret;
unsigned int i, j;
Expand Down Expand Up @@ -1335,17 +1336,16 @@ static int ov2740_check_hwcfg(struct device *dev)

for (i = 0; i < ARRAY_SIZE(link_freq_menu_items); i++) {
for (j = 0; j < bus_cfg.nr_of_link_frequencies; j++) {
if (link_freq_menu_items[i] ==
bus_cfg.link_frequencies[j])
if (link_freq_menu_items[i] == bus_cfg.link_frequencies[j]) {
found = true;
break;
}
}
}

if (j == bus_cfg.nr_of_link_frequencies) {
dev_err(dev, "no link frequency %lld supported",
link_freq_menu_items[i]);
ret = -EINVAL;
goto check_hwcfg_error;
}
if (!found) {
dev_err(dev, "no supported link frequencies\n");
ret = -EINVAL;
}

check_hwcfg_error:
Expand Down

0 comments on commit d7bbd9d

Please sign in to comment.