]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/bridge: lt8912: Convert to drm_of_get_data_lanes_count_ep
authorMarek Vasut <marex@denx.de>
Tue, 24 May 2022 01:05:15 +0000 (03:05 +0200)
committerMarek Vasut <marex@denx.de>
Sun, 12 Jun 2022 10:22:24 +0000 (12:22 +0200)
Convert driver to use this new helper to standardize
OF "data-lanes" parsing.

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Signed-off-by: Marek 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
drivers/gpu/drm/bridge/lontium-lt8912b.c

index c642d1e02b2f8b43131bab76e09315e78bb79fd9..c92515834ff2d078cad3ebbfcd914e33c9511032 100644 (file)
@@ -607,7 +607,6 @@ static int lt8912_parse_dt(struct lt8912 *lt)
        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)) {
@@ -618,16 +617,12 @@ static int lt8912_parse_dt(struct lt8912 *lt)
        }
        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);