Commit 26f6654a authored by Osama Abdelkader's avatar Osama Abdelkader Committed by Luca Ceresoli
Browse files

drm/exynos: remove bridge when component_add fails



Use devm_drm_bridge_add() so the bridge is released if probe fails after
registration, and drop the manual drm_bridge_remove() in remove().

Check the return value of devm_drm_bridge_add().

Signed-off-by: default avatarOsama Abdelkader <osama.abdelkader@gmail.com>
Fixes: 576d72fb ("drm/exynos: mic: add a bridge at probe")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarRaphaël Gallais-Pou <rgallaispou@gmail.com>
Reviewed-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260423200622.325076-2-osama.abdelkader@gmail.com


Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
parent 2d4e8027
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -423,7 +423,9 @@ static int exynos_mic_probe(struct platform_device *pdev)

	mic->bridge.of_node = dev->of_node;

	drm_bridge_add(&mic->bridge);
	ret = devm_drm_bridge_add(dev, &mic->bridge);
	if (ret)
		goto err;

	pm_runtime_enable(dev);

@@ -443,12 +445,8 @@ static int exynos_mic_probe(struct platform_device *pdev)

static void exynos_mic_remove(struct platform_device *pdev)
{
	struct exynos_mic *mic = platform_get_drvdata(pdev);

	component_del(&pdev->dev, &exynos_mic_component_ops);
	pm_runtime_disable(&pdev->dev);

	drm_bridge_remove(&mic->bridge);
}

static const struct of_device_id exynos_mic_of_match[] = {