mirror of
https://github.com/torvalds/linux.git
synced 2024-12-22 10:56:40 +00:00
media: v4l2-fwnode: Switch to use fwnode_property_count_uXX()
Use fwnode_property_count_uXX() directly, that makes code neater. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
bfe655d159
commit
3be9cc6ad3
@ -163,7 +163,7 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
|
||||
pr_debug("no lane mapping given, using defaults\n");
|
||||
}
|
||||
|
||||
rval = fwnode_property_read_u32_array(fwnode, "data-lanes", NULL, 0);
|
||||
rval = fwnode_property_count_u32(fwnode, "data-lanes");
|
||||
if (rval > 0) {
|
||||
num_data_lanes =
|
||||
min_t(int, V4L2_FWNODE_CSI2_MAX_DATA_LANES, rval);
|
||||
@ -191,8 +191,7 @@ static int v4l2_fwnode_endpoint_parse_csi2_bus(struct fwnode_handle *fwnode,
|
||||
pr_debug("lane %u position %u\n", i, array[i]);
|
||||
}
|
||||
|
||||
rval = fwnode_property_read_u32_array(fwnode, "lane-polarities", NULL,
|
||||
0);
|
||||
rval = fwnode_property_count_u32(fwnode, "lane-polarities");
|
||||
if (rval > 0) {
|
||||
if (rval != 1 + num_data_lanes /* clock+data */) {
|
||||
pr_warn("invalid number of lane-polarities entries (need %u, got %u)\n",
|
||||
@ -525,8 +524,7 @@ int v4l2_fwnode_endpoint_alloc_parse(struct fwnode_handle *fwnode,
|
||||
if (rval < 0)
|
||||
return rval;
|
||||
|
||||
rval = fwnode_property_read_u64_array(fwnode, "link-frequencies",
|
||||
NULL, 0);
|
||||
rval = fwnode_property_count_u64(fwnode, "link-frequencies");
|
||||
if (rval > 0) {
|
||||
unsigned int i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user