Commit 1db4b526 authored by Marek Vasut's avatar Marek Vasut

drm/bridge: lt8912: Convert to drm_of_get_data_lanes_count_ep

Convert driver to use this new helper to standardize
OF "data-lanes" parsing.
Reviewed-by: default avatarAndrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Adrien Grassein <adrien.grassein@gmail.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
To: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220524010522.528569-4-marex@denx.de
parent 4af48f1d
...@@ -607,7 +607,6 @@ static int lt8912_parse_dt(struct lt8912 *lt) ...@@ -607,7 +607,6 @@ static int lt8912_parse_dt(struct lt8912 *lt)
int ret; int ret;
int data_lanes; int data_lanes;
struct device_node *port_node; struct device_node *port_node;
struct device_node *endpoint;
gp_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); gp_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(gp_reset)) { if (IS_ERR(gp_reset)) {
...@@ -618,16 +617,12 @@ static int lt8912_parse_dt(struct lt8912 *lt) ...@@ -618,16 +617,12 @@ static int lt8912_parse_dt(struct lt8912 *lt)
} }
lt->gp_reset = gp_reset; lt->gp_reset = gp_reset;
endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); data_lanes = drm_of_get_data_lanes_count_ep(dev->of_node, 0, -1, 1, 4);
if (!endpoint)
return -ENODEV;
data_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
of_node_put(endpoint);
if (data_lanes < 0) { if (data_lanes < 0) {
dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__); dev_err(lt->dev, "%s: Bad data-lanes property\n", __func__);
return data_lanes; return data_lanes;
} }
lt->data_lanes = data_lanes; lt->data_lanes = data_lanes;
lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1); lt->host_node = of_graph_get_remote_node(dev->of_node, 0, -1);
......
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