Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Dmitry Osipenko and committed by
Sam Ravnborg
ea5bc3b1 4ec0a44b

+9
+9
drivers/gpu/drm/drm_of.c
··· 246 246 if (panel) 247 247 *panel = NULL; 248 248 249 + /* 250 + * of_graph_get_remote_node() produces a noisy error message if port 251 + * node isn't found and the absence of the port is a legit case here, 252 + * so at first we silently check whether graph presents in the 253 + * device-tree node. 254 + */ 255 + if (!of_graph_is_present(np)) 256 + return -ENODEV; 257 + 249 258 remote = of_graph_get_remote_node(np, port, endpoint); 250 259 if (!remote) 251 260 return -ENODEV;