summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bridge/parade-ps8640.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2021-10-25 17:15:26 +0200
committerMaxime Ripard <maxime@cerno.tech>2021-10-27 22:07:57 +0200
commitfe93ae800eb846d435359b2d689410fdfc03f868 (patch)
treef654f1a6e9123d8b0632cfcb6b5ca2ee876f725b /drivers/gpu/drm/bridge/parade-ps8640.c
parent4a46ace5ac621c0f84b3910bc3c93acf6c93963b (diff)
downloadlinux-fe93ae800eb846d435359b2d689410fdfc03f868.tar.bz2
drm/bridge: ps8640: 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 on removal. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-12-maxime@cerno.tech
Diffstat (limited to 'drivers/gpu/drm/bridge/parade-ps8640.c')
-rw-r--r--drivers/gpu/drm/bridge/parade-ps8640.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c
index 3aaa90913bf8..5ae15fc407c5 100644
--- a/drivers/gpu/drm/bridge/parade-ps8640.c
+++ b/drivers/gpu/drm/bridge/parade-ps8640.c
@@ -428,7 +428,7 @@ static int ps8640_bridge_attach(struct drm_bridge *bridge,
if (!host)
return -ENODEV;
- 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);
@@ -442,27 +442,22 @@ static int ps8640_bridge_attach(struct drm_bridge *bridge,
MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->lanes = NUM_MIPI_LANES;
- ret = mipi_dsi_attach(dsi);
+
+ ret = devm_mipi_dsi_attach(dev, dsi);
if (ret) {
dev_err(dev, "failed to attach dsi device: %d\n", ret);
- goto err_dsi_attach;
+ return ret;
}
ret = drm_dp_aux_register(&ps_bridge->aux);
if (ret) {
dev_err(dev, "failed to register DP AUX channel: %d\n", ret);
- goto err_aux_register;
+ return ret;
}
/* Attach the panel-bridge to the dsi bridge */
return drm_bridge_attach(bridge->encoder, ps_bridge->panel_bridge,
&ps_bridge->bridge, flags);
-
-err_aux_register:
- mipi_dsi_detach(dsi);
-err_dsi_attach:
- mipi_dsi_device_unregister(dsi);
- return ret;
}
static void ps8640_bridge_detach(struct drm_bridge *bridge)