From: Hüseyin BIYIK <[email protected]>

The function devm_drm_bridge_alloc() is the new API for allocating DRM bridges.
This conversion was missed during the initial conversion of all bridges to
the new API.

Signed-off-by: Hüseyin BIYIK <[email protected]>
Signed-off-by: Johan Jonker <[email protected]>
---

Changed V3:
rebase
remove driver_private
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c 
b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index f28d6a883e09..05dbbcc6f7b0 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -702,8 +702,6 @@ rk3066_hdmi_register(struct drm_device *drm, struct 
rk3066_hdmi *hdmi)
        drm_encoder_init(drm, encoder, &rk3066_hdmi_encoder_funcs,
                         DRM_MODE_ENCODER_TMDS, NULL);
 
-       hdmi->bridge.driver_private = hdmi;
-       hdmi->bridge.funcs = &rk3066_hdmi_bridge_funcs;
        hdmi->bridge.ops = DRM_BRIDGE_OP_DETECT |
                           DRM_BRIDGE_OP_EDID |
                           DRM_BRIDGE_OP_HDMI |
@@ -747,9 +745,10 @@ static int rk3066_hdmi_bind(struct device *dev, struct 
device *master,
        int irq;
        int ret;
 
-       hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL);
-       if (!hdmi)
-               return -ENOMEM;
+       hdmi = devm_drm_bridge_alloc(dev, struct rk3066_hdmi, bridge,
+                                    &rk3066_hdmi_bridge_funcs);
+       if (IS_ERR(hdmi))
+               return PTR_ERR(hdmi);
 
        hdmi->dev = dev;
        hdmi->drm_dev = drm;

---
base-commit: 9d80aa4617b32f5054c5aa471d06b66704854935
change-id: 20260904-drm-9d7835c33ad6

Best regards,
-- 
Johan Jonker <[email protected]>


Reply via email to