int ret;
int data_lanes;
struct device_node *port_node;
- struct device_node *endpoint;
gp_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(gp_reset)) {
}
lt->gp_reset = gp_reset;
- endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
- if (!endpoint)
- return -ENODEV;
-
- data_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
- of_node_put(endpoint);
+ data_lanes = drm_of_get_data_lanes_count_ep(dev->of_node, 0, -1, 1, 4);
if (data_lanes < 0) {
dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__);
return data_lanes;
}
+
lt->data_lanes = data_lanes;
lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1);