summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mediatek/mtk_dpi.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-03-22 08:26:06 -0500
committerSean Paul <seanpaul@chromium.org>2017-04-06 17:00:27 -0400
commit86418f90a4c1a0073db65d8a1e2bf94421117a60 (patch)
treea82b9534e5f5c89ceeaa93abaad71da000c7f8d3 /drivers/gpu/drm/mediatek/mtk_dpi.c
parent1f2db3034c9f16ed918e34809167546f21d0fcb4 (diff)
downloadlinux-86418f90a4c1a0073db65d8a1e2bf94421117a60.tar.gz
linux-86418f90a4c1a0073db65d8a1e2bf94421117a60.tar.bz2
linux-86418f90a4c1a0073db65d8a1e2bf94421117a60.zip
drm: convert drivers to use of_graph_get_remote_node
Convert drivers to use the new of_graph_get_remote_node() helper instead of parsing the endpoint node and then getting the remote device node. Now drivers can just specify the device node and which port/endpoint and get back the connected remote device node. The details of the graph binding are nicely abstracted into the core OF graph code. This changes some error messages to debug messages (in the graph core). Graph connections are often "no connects" depending on the particular board, so we want to avoid spurious messages. Plus the kernel is not a DT validator. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: Liviu Dudau <liviu.dudau@arm.com> Tested-by: Eric Anholt <eric@anholt.net> Tested-by: Jyri Sarha <jsarha@ti.com> Tested by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_dpi.c')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_dpi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 3bd3bd688d1a..32ca351ecd09 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -661,7 +661,7 @@ static int mtk_dpi_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct mtk_dpi *dpi;
struct resource *mem;
- struct device_node *ep, *bridge_node = NULL;
+ struct device_node *bridge_node;
int comp_id;
int ret;
@@ -706,15 +706,9 @@ static int mtk_dpi_probe(struct platform_device *pdev)
return -EINVAL;
}
- ep = of_graph_get_next_endpoint(dev->of_node, NULL);
- if (ep) {
- bridge_node = of_graph_get_remote_port_parent(ep);
- of_node_put(ep);
- }
- if (!bridge_node) {
- dev_err(dev, "Failed to find bridge node\n");
+ bridge_node = of_graph_get_remote_node(dev->of_node, 0, 0);
+ if (!bridge_node)
return -ENODEV;
- }
dev_info(dev, "Found bridge node: %s\n", bridge_node->full_name);