[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211025151536.1048186-6-maxime@cerno.tech>
Date: Mon, 25 Oct 2021 17:15:20 +0200
From: Maxime Ripard <maxime@...no.tech>
To: Thierry Reding <thierry.reding@...il.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Andrzej Hajda <a.hajda@...sung.com>,
Robert Foss <robert.foss@...aro.org>,
Jonas Karlman <jonas@...boo.se>,
Daniel Vetter <daniel.vetter@...el.com>,
David Airlie <airlied@...ux.ie>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Maxime Ripard <maxime@...no.tech>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Sam Ravnborg <sam@...nborg.org>,
Neil Armstrong <narmstrong@...libre.com>
Cc: Seung-Woo Kim <sw0312.kim@...sung.com>,
linux-arm-msm@...r.kernel.org,
Joonyoung Shim <jy0922.shim@...sung.com>,
Rob Clark <robdclark@...il.com>,
Tian Tao <tiantao6@...ilicon.com>,
Chen Feng <puck.chen@...ilicon.com>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
linux-samsung-soc@...r.kernel.org,
Xinliang Liu <xinliang.liu@...aro.org>,
John Stultz <john.stultz@...aro.org>,
linux-kernel@...r.kernel.org, Inki Dae <inki.dae@...sung.com>,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
Sean Paul <sean@...rly.run>
Subject: [PATCH v6 05/21] drm/bridge: lt8912b: Switch to devm MIPI-DSI helpers
Let's switch to the new devm MIPI-DSI function to register and attach
our secondary device.
Acked-by: Sam Ravnborg <sam@...nborg.org>
Signed-off-by: Maxime Ripard <maxime@...no.tech>
---
drivers/gpu/drm/bridge/lontium-lt8912b.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/bridge/lontium-lt8912b.c
index 1b0c7eaf6c84..cc968d65936b 100644
--- a/drivers/gpu/drm/bridge/lontium-lt8912b.c
+++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c
@@ -472,11 +472,11 @@ static int lt8912_attach_dsi(struct lt8912 *lt)
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)) {
ret = PTR_ERR(dsi);
dev_err(dev, "failed to create dsi device (%d)\n", ret);
- goto err_dsi_device;
+ return ret;
}
lt->dsi = dsi;
@@ -489,24 +489,13 @@ static int lt8912_attach_dsi(struct lt8912 *lt)
MIPI_DSI_MODE_LPM |
MIPI_DSI_MODE_NO_EOT_PACKET;
- 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;
}
return 0;
-
-err_dsi_attach:
- mipi_dsi_device_unregister(dsi);
-err_dsi_device:
- return ret;
-}
-
-static void lt8912_detach_dsi(struct lt8912 *lt)
-{
- mipi_dsi_detach(lt->dsi);
- mipi_dsi_device_unregister(lt->dsi);
}
static int lt8912_bridge_connector_init(struct drm_bridge *bridge)
@@ -573,7 +562,6 @@ static void lt8912_bridge_detach(struct drm_bridge *bridge)
struct lt8912 *lt = bridge_to_lt8912(bridge);
if (lt->is_attached) {
- lt8912_detach_dsi(lt);
lt8912_hard_power_off(lt);
drm_connector_unregister(<->connector);
drm_connector_cleanup(<->connector);
--
2.31.1
Powered by blists - more mailing lists