mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
media: v4l: fwnode: Fix lane-polarities property parsing
fwnode_property_read_u32_array() only returns the number of array elements
if the array argument is NULL. The assumption that it always did so lead to
lane-polarities properties never being read.
Fixes: 4ee236219f
("media: v4l2-fwnode: suppress a warning at OF parsing logic")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
f758eb2363
commit
b24f021579
1 changed files with 7 additions and 3 deletions
|
@ -65,19 +65,23 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
|
|||
}
|
||||
|
||||
rval = fwnode_property_read_u32_array(fwnode,
|
||||
"lane-polarities", array,
|
||||
1 + bus->num_data_lanes);
|
||||
"lane-polarities", NULL,
|
||||
0);
|
||||
if (rval > 0) {
|
||||
if (rval != 1 + bus->num_data_lanes /* clock + data */) {
|
||||
if (rval != 1 + bus->num_data_lanes /* clock+data */) {
|
||||
pr_warn("invalid number of lane-polarities entries (need %u, got %u)\n",
|
||||
1 + bus->num_data_lanes, rval);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fwnode_property_read_u32_array(fwnode,
|
||||
"lane-polarities", array,
|
||||
1 + bus->num_data_lanes);
|
||||
|
||||
for (i = 0; i < 1 + bus->num_data_lanes; i++)
|
||||
bus->lane_polarities[i] = array[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!fwnode_property_read_u32(fwnode, "clock-lanes", &v)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue