Commit fd2e66ab authored by Fabio Estevam's avatar Fabio Estevam Committed by Hans Verkuil

media: ov2680: Allow probing if link-frequencies is absent

Since commit 63b0cd30 ("media: ov2680: Add bus-cfg / endpoint
property verification") the ov2680 no longer probes on a imx7s-warp7:

ov2680 1-0036: error -EINVAL: supported link freq 330000000 not found
ov2680 1-0036: probe with driver ov2680 failed with error -22

As the 'link-frequencies' property is not mandatory, allow the probe
to succeed by skipping the link-frequency verification when the
property is absent.

Cc: stable@vger.kernel.org
Fixes: 63b0cd30 ("media: ov2680: Add bus-cfg / endpoint property verification")
Signed-off-by: default avatarFabio Estevam <festevam@denx.de>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 49a9bad8
...@@ -1123,18 +1123,23 @@ static int ov2680_parse_dt(struct ov2680_dev *sensor) ...@@ -1123,18 +1123,23 @@ static int ov2680_parse_dt(struct ov2680_dev *sensor)
goto out_free_bus_cfg; goto out_free_bus_cfg;
} }
if (!bus_cfg.nr_of_link_frequencies) {
dev_warn(dev, "Consider passing 'link-frequencies' in DT\n");
goto skip_link_freq_validation;
}
for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++) for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++)
if (bus_cfg.link_frequencies[i] == sensor->link_freq[0]) if (bus_cfg.link_frequencies[i] == sensor->link_freq[0])
break; break;
if (bus_cfg.nr_of_link_frequencies == 0 || if (bus_cfg.nr_of_link_frequencies == i) {
bus_cfg.nr_of_link_frequencies == i) {
ret = dev_err_probe(dev, -EINVAL, ret = dev_err_probe(dev, -EINVAL,
"supported link freq %lld not found\n", "supported link freq %lld not found\n",
sensor->link_freq[0]); sensor->link_freq[0]);
goto out_free_bus_cfg; goto out_free_bus_cfg;
} }
skip_link_freq_validation:
ret = 0; ret = 0;
out_free_bus_cfg: out_free_bus_cfg:
v4l2_fwnode_endpoint_free(&bus_cfg); v4l2_fwnode_endpoint_free(&bus_cfg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment