[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220317175852.799432-1-jose.exposito89@gmail.com>
Date: Thu, 17 Mar 2022 18:58:52 +0100
From: José Expósito <jose.exposito89@...il.com>
To: victor.liu@....nxp.com
Cc: andrzej.hajda@...el.com, narmstrong@...libre.com,
robert.foss@...aro.org, Laurent.pinchart@...asonboard.com,
jonas@...boo.se, jernej.skrabec@...il.com, airlied@...ux.ie,
daniel@...ll.ch, p.zabel@...gutronix.de,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
José Expósito <jose.exposito89@...il.com>
Subject: [PATCH v2] drm/bridge: nwl-dsi: switch to devm_drm_of_get_bridge
The function "drm_of_find_panel_or_bridge" has been deprecated in
favor of "devm_drm_of_get_bridge".
Switch to the new function and reduce boilerplate.
Signed-off-by: José Expósito <jose.exposito89@...il.com>
---
v2: (Thanks to Liu Ying)
- Rebase on top of drm-misc-next
- Remove drm_of_panel_bridge_remove
---
drivers/gpu/drm/bridge/nwl-dsi.c | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index e34fb09b90b9..de62e3fc6a59 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -912,19 +912,11 @@ static int nwl_dsi_bridge_attach(struct drm_bridge *bridge,
{
struct nwl_dsi *dsi = bridge_to_dsi(bridge);
struct drm_bridge *panel_bridge;
- struct drm_panel *panel;
- int ret;
-
- ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel,
- &panel_bridge);
- if (ret)
- return ret;
- if (panel) {
- panel_bridge = drm_panel_bridge_add(panel);
- if (IS_ERR(panel_bridge))
- return PTR_ERR(panel_bridge);
- }
+ panel_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node,
+ 1, 0);
+ if (IS_ERR(panel_bridge))
+ return PTR_ERR(panel_bridge);
if (!panel_bridge)
return -EPROBE_DEFER;
@@ -932,12 +924,6 @@ static int nwl_dsi_bridge_attach(struct drm_bridge *bridge,
return drm_bridge_attach(bridge->encoder, panel_bridge, bridge, flags);
}
-static void nwl_dsi_bridge_detach(struct drm_bridge *bridge)
-{ struct nwl_dsi *dsi = bridge_to_dsi(bridge);
-
- drm_of_panel_bridge_remove(dsi->dev->of_node, 1, 0);
-}
-
static u32 *nwl_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
@@ -983,7 +969,6 @@ static const struct drm_bridge_funcs nwl_dsi_bridge_funcs = {
.mode_set = nwl_dsi_bridge_mode_set,
.mode_valid = nwl_dsi_bridge_mode_valid,
.attach = nwl_dsi_bridge_attach,
- .detach = nwl_dsi_bridge_detach,
};
static int nwl_dsi_parse_dt(struct nwl_dsi *dsi)
--
2.25.1
Powered by blists - more mailing lists