int dsi_lanes, ret;
endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
- dsi_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
+ dsi_lanes = drm_of_get_data_lanes_count(endpoint, 1, 4);
host_node = of_graph_get_remote_port_parent(endpoint);
host = of_find_mipi_dsi_host_by_node(host_node);
of_node_put(host_node);
of_node_put(endpoint);
- if (dsi_lanes <= 0 || dsi_lanes > 4)
- return -EINVAL;
-
if (!host)
return -EPROBE_DEFER;
+ if (dsi_lanes < 0)
+ return dsi_lanes;
+
dsi = mipi_dsi_device_register_full(host, &info);
if (IS_ERR(dsi))
return dev_err_probe(dev, PTR_ERR(dsi),