[PATCH 1/2] drm/rockchip: rk3066_hdmi: Convert to devm_drm_bridge_alloc() API
Cristian Ciocaltea
cristian.ciocaltea at collabora.com
Thu Oct 1 01:25:11 PDT 2026
Bridge drivers are expected to use devm_drm_bridge_alloc() instead of
devm_kzalloc() for allocating and partially initializing a private
driver struct embedding a struct drm_bridge.
Perform the API conversion and drop the now redundant manual
initialization of the drm_bridge funcs pointer, following the pattern
established by commit 9c399719cfb9 ("drm: convert many bridge drivers
from devm_kzalloc() to devm_drm_bridge_alloc() API").
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea at collabora.com>
---
drivers/gpu/drm/rockchip/rk3066_hdmi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index f28d6a883e09..39c65ee07caa 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -703,7 +703,6 @@ rk3066_hdmi_register(struct drm_device *drm, struct rk3066_hdmi *hdmi)
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 +746,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;
--
2.55.0
More information about the Linux-rockchip
mailing list