summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_of.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2022-04-05 12:37:03 +0300
committerMaxime Ripard <maxime@cerno.tech>2022-04-05 12:37:03 +0300
commitcf5c5763eb531ff5120111ad300126e926fb5a56 (patch)
tree41e3d49ad46f08fd6025264451390c7dc204303a /drivers/gpu/drm/drm_of.c
parent8047f98c8958d0f0c29882298ec293ff09ffea92 (diff)
parent3123109284176b1532874591f7c81f3837bbdc17 (diff)
downloadlinux-cf5c5763eb531ff5120111ad300126e926fb5a56.tar.xz
Merge drm/drm-fixes into drm-misc-fixes
Let's start the 5.18 fixes cycle. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/drm_of.c')
-rw-r--r--drivers/gpu/drm/drm_of.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 59d368ea006b..026e4e29a0f3 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -18,11 +18,6 @@
* properties.
*/
-static void drm_release_of(struct device *dev, void *data)
-{
- of_node_put(data);
-}
-
/**
* drm_of_crtc_port_mask - find the mask of a registered CRTC by port OF node
* @dev: DRM device
@@ -94,7 +89,7 @@ void drm_of_component_match_add(struct device *master,
struct device_node *node)
{
of_node_get(node);
- component_match_add_release(master, matchptr, drm_release_of,
+ component_match_add_release(master, matchptr, component_release_of,
compare, node);
}
EXPORT_SYMBOL_GPL(drm_of_component_match_add);
@@ -249,6 +244,21 @@ int drm_of_find_panel_or_bridge(const struct device_node *np,
if (panel)
*panel = NULL;
+ /**
+ * Devices can also be child nodes when we also control that device
+ * through the upstream device (ie, MIPI-DCS for a MIPI-DSI device).
+ *
+ * Lookup for a child node of the given parent that isn't either port
+ * or ports.
+ */
+ for_each_available_child_of_node(np, remote) {
+ if (of_node_name_eq(remote, "port") ||
+ of_node_name_eq(remote, "ports"))
+ continue;
+
+ goto of_find_panel_or_bridge;
+ }
+
/*
* 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,
@@ -259,6 +269,8 @@ int drm_of_find_panel_or_bridge(const struct device_node *np,
return -ENODEV;
remote = of_graph_get_remote_node(np, port, endpoint);
+
+of_find_panel_or_bridge:
if (!remote)
return -ENODEV;