[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211021073947.499373-19-maxime@cerno.tech>
Date: Thu, 21 Oct 2021 09:39:44 +0200
From: Maxime Ripard <maxime@...no.tech>
To: Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Maxime Ripard <maxime@...no.tech>,
Sam Ravnborg <sam@...nborg.org>,
Daniel Vetter <daniel.vetter@...el.com>,
David Airlie <airlied@...ux.ie>,
Thierry Reding <thierry.reding@...il.com>,
Andrzej Hajda <a.hajda@...sung.com>,
Robert Foss <robert.foss@...aro.org>,
Neil Armstrong <narmstrong@...libre.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>
Cc: Seung-Woo Kim <sw0312.kim@...sung.com>,
Xinliang Liu <xinliang.liu@...aro.org>,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
Tian Tao <tiantao6@...ilicon.com>,
freedreno@...ts.freedesktop.org,
Chen Feng <puck.chen@...ilicon.com>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
John Stultz <john.stultz@...aro.org>,
Rob Clark <robdclark@...il.com>, linux-arm-msm@...r.kernel.org,
Sean Paul <sean@...rly.run>, Inki Dae <inki.dae@...sung.com>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
dri-devel@...ts.freedesktop.org
Subject: [PATCH v5 18/21] drm/bridge: tc358775: Switch to devm MIPI-DSI helpers
Let's switch to the new devm MIPI-DSI function to register and attach
our secondary device. This also avoids leaking the device when we detach
the bridge.
Acked-by: Sam Ravnborg <sam@...nborg.org>
Signed-off-by: Maxime Ripard <maxime@...no.tech>
---
drivers/gpu/drm/bridge/tc358775.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c
index 2272adcc5b4a..35e66d1b6456 100644
--- a/drivers/gpu/drm/bridge/tc358775.c
+++ b/drivers/gpu/drm/bridge/tc358775.c
@@ -610,11 +610,10 @@ static int tc_bridge_attach(struct drm_bridge *bridge,
return -EPROBE_DEFER;
}
- dsi = mipi_dsi_device_register_full(host, &info);
+ dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
if (IS_ERR(dsi)) {
dev_err(dev, "failed to create dsi device\n");
- ret = PTR_ERR(dsi);
- goto err_dsi_device;
+ return PTR_ERR(dsi);
}
tc->dsi = dsi;
@@ -623,19 +622,15 @@ static int tc_bridge_attach(struct drm_bridge *bridge,
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO;
- ret = mipi_dsi_attach(dsi);
+ ret = devm_mipi_dsi_attach(dev, dsi);
if (ret < 0) {
dev_err(dev, "failed to attach dsi to host\n");
- goto err_dsi_attach;
+ return ret;
}
/* Attach the panel-bridge to the dsi bridge */
return drm_bridge_attach(bridge->encoder, tc->panel_bridge,
&tc->bridge, flags);
-err_dsi_attach:
- mipi_dsi_device_unregister(dsi);
-err_dsi_device:
- return ret;
}
static const struct drm_bridge_funcs tc_bridge_funcs = {
--
2.31.1
Powered by blists - more mailing lists