[PATCH] drm/omap: switch to drm_of_find_panel_or_bridge

From: José Expósito
Date: Sun Feb 20 2022 - 14:52:44 EST


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@xxxxxxxxx>
---
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