Commit 2e64a174 authored by Boris Brezillon's avatar Boris Brezillon Committed by Thierry Reding

drm/of: Make drm_of_find_panel_or_bridge() fail when the device is disabled

There's no point searching for a drm_bridge or drm_panel if the OF node
we're pointing has a status property that is not "okay" or "ok". Just
return -ENODEV in this case.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-4-boris.brezillon@bootlin.com
parent c59eb3cf
...@@ -239,6 +239,11 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, ...@@ -239,6 +239,11 @@ int drm_of_find_panel_or_bridge(const struct device_node *np,
if (!remote) if (!remote)
return -ENODEV; return -ENODEV;
if (!of_device_is_available(remote)) {
of_node_put(remote);
return -ENODEV;
}
if (panel) { if (panel) {
*panel = of_drm_find_panel(remote); *panel = of_drm_find_panel(remote);
if (!IS_ERR(*panel)) if (!IS_ERR(*panel))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment