lkml.org 
[lkml]   [2022]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/omap: switch to drm_of_find_panel_or_bridge
Date
Use the "drm_of_find_panel_or_bridge" function instead of a custom
version of it to reduce the boilerplate.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
drivers/gpu/drm/omapdrm/dss/output.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
index 7378e855c278..00af27589296 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -20,23 +20,18 @@
int omapdss_device_init_output(struct omap_dss_device *out,
struct drm_bridge *local_bridge)
{
- struct device_node *remote_node;
int ret;

- remote_node = of_graph_get_remote_node(out->dev->of_node,
- out->of_port, 0);
- if (!remote_node) {
- dev_dbg(out->dev, "failed to find video sink\n");
- return 0;
+ ret = drm_of_find_panel_or_bridge(out->dev->of_node, out->of_port, 0,
+ &out->panel, &out->bridge);
+ if (ret) {
+ if (ret == -ENODEV) {
+ dev_dbg(out->dev, "failed to find video sink\n");
+ return 0;
+ }
+ goto error;
}

- out->bridge = of_drm_find_bridge(remote_node);
- out->panel = of_drm_find_panel(remote_node);
- if (IS_ERR(out->panel))
- out->panel = NULL;
-
- of_node_put(remote_node);
-
if (out->panel) {
struct drm_bridge *bridge;

--
2.25.1
\
 
 \ /
  Last update: 2022-09-17 16:14    [W:0.116 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site