summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/dsi/dsi_manager.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2023-10-09 23:57:23 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2024-02-11 23:38:06 +0300
commitec97f371895f83fb0c123187d26d19bdb927621f (patch)
treecab1d324d084f45c84079c4a7b019a29b67c158b /drivers/gpu/drm/msm/dsi/dsi_manager.c
parent41c177cf354126a22443b5c80cec9fdd313e67e1 (diff)
downloadlinux-ec97f371895f83fb0c123187d26d19bdb927621f.tar.xz
drm/msm/dsi: do not store internal bridge pointer
Since the driver was switched to devm_drm_bridge_add(), there is no need anymore to store the created bridge instance in struct msm_dsi. Drop this field and pass data directly. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/561693/ Link: https://lore.kernel.org/r/20231009205727.2781802-2-dmitry.baryshkov@linaro.org
Diffstat (limited to 'drivers/gpu/drm/msm/dsi/dsi_manager.c')
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi_manager.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 896f369fdd53..f5285faefc61 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -466,9 +466,9 @@ static const struct drm_bridge_funcs dsi_mgr_bridge_funcs = {
};
/* initialize bridge */
-int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi)
+struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi)
{
- struct drm_bridge *bridge = NULL;
+ struct drm_bridge *bridge;
struct dsi_bridge *dsi_bridge;
struct drm_encoder *encoder;
int ret;
@@ -476,7 +476,7 @@ int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi)
dsi_bridge = devm_kzalloc(msm_dsi->dev->dev,
sizeof(*dsi_bridge), GFP_KERNEL);
if (!dsi_bridge)
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
dsi_bridge->id = msm_dsi->id;
@@ -487,26 +487,23 @@ int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi)
ret = devm_drm_bridge_add(msm_dsi->dev->dev, bridge);
if (ret)
- return ret;
+ return ERR_PTR(ret);
ret = drm_bridge_attach(encoder, bridge, NULL, 0);
if (ret)
- return ret;
+ return ERR_PTR(ret);
- msm_dsi->bridge = bridge;
-
- return 0;
+ return bridge;
}
-int msm_dsi_manager_ext_bridge_init(u8 id)
+int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge)
{
struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
struct drm_device *dev = msm_dsi->dev;
struct drm_encoder *encoder;
- struct drm_bridge *int_bridge, *ext_bridge;
+ struct drm_bridge *ext_bridge;
int ret;
- int_bridge = msm_dsi->bridge;
ext_bridge = devm_drm_of_get_bridge(&msm_dsi->pdev->dev,
msm_dsi->pdev->dev.of_node, 1, 0);
if (IS_ERR(ext_bridge))