diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2023-10-09 21:10:29 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2023-10-09 21:37:34 +0300 |
commit | 719093a67c7f82c997b0d0eb55ed5deaa88bec7b (patch) | |
tree | 7f00ae4d62924256223d62958fef93c398fd964d /drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | |
parent | 5f403fd7d5c2a33be51b7f4cd4d0219e314d90f1 (diff) | |
download | linux-719093a67c7f82c997b0d0eb55ed5deaa88bec7b.tar.xz |
drm/msm/hdmi: switch to devm_drm_bridge_add()
Make MSM HDMI driver use devm_drm_bridge_add() instead of plain
drm_bridge_add(). As the driver doesn't require any additional cleanup,
stop adding created bridge to the priv->bridges array.
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/561635/
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/hdmi/hdmi_bridge.c')
-rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index 9b1391d27ed3..0b7a6a56677e 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -11,14 +11,6 @@ #include "msm_kms.h" #include "hdmi.h" -void msm_hdmi_bridge_destroy(struct drm_bridge *bridge) -{ - struct hdmi_bridge *hdmi_bridge = to_hdmi_bridge(bridge); - - msm_hdmi_hpd_disable(hdmi_bridge); - drm_bridge_remove(bridge); -} - static void msm_hdmi_power_on(struct drm_bridge *bridge) { struct drm_device *dev = bridge->dev; @@ -317,7 +309,7 @@ msm_hdmi_hotplug_work(struct work_struct *work) } /* initialize bridge */ -struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) +int msm_hdmi_bridge_init(struct hdmi *hdmi) { struct drm_bridge *bridge = NULL; struct hdmi_bridge *hdmi_bridge; @@ -325,10 +317,8 @@ struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) hdmi_bridge = devm_kzalloc(hdmi->dev->dev, sizeof(*hdmi_bridge), GFP_KERNEL); - if (!hdmi_bridge) { - ret = -ENOMEM; - goto fail; - } + if (!hdmi_bridge) + return -ENOMEM; hdmi_bridge->hdmi = hdmi; INIT_WORK(&hdmi_bridge->hpd_work, msm_hdmi_hotplug_work); @@ -341,17 +331,15 @@ struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID; - drm_bridge_add(bridge); + ret = devm_drm_bridge_add(&hdmi->pdev->dev, bridge); + if (ret) + return ret; ret = drm_bridge_attach(hdmi->encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (ret) - goto fail; + return ret; - return bridge; + hdmi->bridge = bridge; -fail: - if (bridge) - msm_hdmi_bridge_destroy(bridge); - - return ERR_PTR(ret); + return 0; } |