summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_of.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2020-07-01 10:42:32 +0300
committerSam Ravnborg <sam@ravnborg.org>2020-07-01 11:49:25 +0300
commitea5bc3b15e0f2a245ef1b0093ebe8bc489d49936 (patch)
treeeb61c223395aec0acb01dd8eddb96b2004c30a46 /drivers/gpu/drm/drm_of.c
parent4ec0a44ba8d797876ff416fc0317a0169483d240 (diff)
downloadlinux-ea5bc3b15e0f2a245ef1b0093ebe8bc489d49936.tar.xz
drm/of: Make drm_of_find_panel_or_bridge() to check graph's presence
When graph isn't defined in a device-tree, the of_graph_get_remote_node() prints a noisy error message, telling that port node is not found. This is undesirable behaviour in our case because absence of a panel/bridge graph is a valid case. Let's check the graph's presence in a device-tree before proceeding with parsing of the graph. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200701074232.13632-3-digetx@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_of.c')
-rw-r--r--drivers/gpu/drm/drm_of.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index b50b44e76279..fdb05fbf72a0 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -246,6 +246,15 @@ int drm_of_find_panel_or_bridge(const struct device_node *np,
if (panel)
*panel = NULL;
+ /*
+ * of_graph_get_remote_node() produces a noisy error message if port
+ * node isn't found and the absence of the port is a legit case here,
+ * so at first we silently check whether graph presents in the
+ * device-tree node.
+ */
+ if (!of_graph_is_present(np))
+ return -ENODEV;
+
remote = of_graph_get_remote_node(np, port, endpoint);
if (!remote)
return -ENODEV;