diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2023-10-09 23:57:23 +0300 |
---|---|---|
committer | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2024-02-11 23:38:06 +0300 |
commit | ec97f371895f83fb0c123187d26d19bdb927621f (patch) | |
tree | cab1d324d084f45c84079c4a7b019a29b67c158b /drivers/gpu/drm | |
parent | 41c177cf354126a22443b5c80cec9fdd313e67e1 (diff) | |
download | linux-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')
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi.h | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/dsi/dsi_manager.c | 19 |
3 files changed, 15 insertions, 19 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index c6bd7bf15605..0edc1da256ec 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -216,6 +216,7 @@ void __exit msm_dsi_unregister(void) int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, struct drm_encoder *encoder) { + struct drm_bridge *bridge; int ret; msm_dsi->dev = dev; @@ -237,13 +238,14 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, msm_dsi->encoder = encoder; - ret = msm_dsi_manager_bridge_init(msm_dsi); - if (ret) { + bridge = msm_dsi_manager_bridge_init(msm_dsi); + if (IS_ERR(bridge)) { + ret = PTR_ERR(bridge); DRM_DEV_ERROR(dev->dev, "failed to create dsi bridge: %d\n", ret); return ret; } - ret = msm_dsi_manager_ext_bridge_init(msm_dsi->id); + ret = msm_dsi_manager_ext_bridge_init(msm_dsi->id, bridge); if (ret) { DRM_DEV_ERROR(dev->dev, "failed to create dsi connector: %d\n", ret); diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 28379b1af63f..84c0b04e41e1 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -35,9 +35,6 @@ struct msm_dsi { struct drm_device *dev; struct platform_device *pdev; - /* internal dsi bridge attached to MDP interface */ - struct drm_bridge *bridge; - struct mipi_dsi_host *host; struct msm_dsi_phy *phy; @@ -56,8 +53,8 @@ struct msm_dsi { }; /* dsi manager */ -int msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi); -int msm_dsi_manager_ext_bridge_init(u8 id); +struct drm_bridge *msm_dsi_manager_bridge_init(struct msm_dsi *msm_dsi); +int msm_dsi_manager_ext_bridge_init(u8 id, struct drm_bridge *int_bridge); int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg); bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); int msm_dsi_manager_register(struct msm_dsi *msm_dsi); 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)) |