diff options
author | Sui Jingfeng <sui.jingfeng@linux.dev> | 2024-03-17 01:28:00 +0800 |
---|---|---|
committer | Neil Armstrong <neil.armstrong@linaro.org> | 2024-03-18 16:16:55 +0100 |
commit | 00084f0c01bf3a2591d007010b196e048281c455 (patch) | |
tree | 9ec0714bade7b02d31ba321d18ea303d72a2011b /drivers | |
parent | 2c7d26555845ca5fb70353b4b77d8f6c4e32e54c (diff) |
drm: bridge: thc63lvd1024: Switch to use of_graph_get_remote_node()
To reduce boilerplate, use of_graph_get_remote_node() helper instead of
the hand-rolling code.
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240316172800.1168390-1-sui.jingfeng@linux.dev
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240316172800.1168390-1-sui.jingfeng@linux.dev
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/bridge/thc63lvd1024.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c index d4c1a601bbb5..5f99f9724081 100644 --- a/drivers/gpu/drm/bridge/thc63lvd1024.c +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c @@ -123,28 +123,10 @@ static int thc63_parse_dt(struct thc63_dev *thc63) struct device_node *endpoint; struct device_node *remote; - endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node, - THC63_RGB_OUT0, -1); - if (!endpoint) { - dev_err(thc63->dev, "Missing endpoint in port@%u\n", - THC63_RGB_OUT0); - return -ENODEV; - } - - remote = of_graph_get_remote_port_parent(endpoint); - of_node_put(endpoint); - if (!remote) { - dev_err(thc63->dev, "Endpoint in port@%u unconnected\n", - THC63_RGB_OUT0); + remote = of_graph_get_remote_node(thc63->dev->of_node, + THC63_RGB_OUT0, -1); + if (!remote) return -ENODEV; - } - - if (!of_device_is_available(remote)) { - dev_err(thc63->dev, "port@%u remote endpoint is disabled\n", - THC63_RGB_OUT0); - of_node_put(remote); - return -ENODEV; - } thc63->next = of_drm_find_bridge(remote); of_node_put(remote); |