[PATCH 14/34] drm/exynos: mic: convert to devm_drm_bridge_alloc() API

Luca Ceresoli luca.ceresoli at bootlin.com
Mon Apr 7 14:23:29 UTC 2025


This is the new API for allocating DRM bridges.

Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>

---

Cc: Alim Akhtar <alim.akhtar at samsung.com>
Cc: Inki Dae <inki.dae at samsung.com>
Cc: Kyungmin Park <kyungmin.park at samsung.com>
Cc: Seung-Woo Kim <sw0312.kim at samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_mic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index b34ec67283370e3fa836c7df06e12e2fba524622..29a8366513fa70655c6ceec9a09db0158e7bb169 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -379,11 +379,11 @@ static int exynos_mic_probe(struct platform_device *pdev)
 	struct resource res;
 	int ret, i;
 
-	mic = devm_kzalloc(dev, sizeof(*mic), GFP_KERNEL);
-	if (!mic) {
+	mic = devm_drm_bridge_alloc(dev, struct exynos_mic, bridge, &mic_bridge_funcs);
+	if (IS_ERR(mic)) {
 		DRM_DEV_ERROR(dev,
 			      "mic: Failed to allocate memory for MIC object\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(mic);
 		goto err;
 	}
 
@@ -421,7 +421,6 @@ static int exynos_mic_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mic);
 
-	mic->bridge.funcs = &mic_bridge_funcs;
 	mic->bridge.of_node = dev->of_node;
 
 	drm_bridge_add(&mic->bridge);

-- 
2.49.0



More information about the Freedreno mailing list