public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/sti: hdmi: remove bridge when component_add fails
@ 2026-04-10 19:41 Osama Abdelkader
  2026-04-14  7:24 ` Luca Ceresoli
  0 siblings, 1 reply; 2+ messages in thread
From: Osama Abdelkader @ 2026-04-10 19:41 UTC (permalink / raw)
  To: luca.ceresoli, Alain Volmat, Raphael Gallais-Pou,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel
  Cc: Osama Abdelkader

when component_add fails in sti_hdmi_probe remove the drm bridge
and put i2c adapter before return

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/sti/sti_hdmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index f8222e60b1e0..839c80a7d954 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -1460,8 +1460,13 @@ static int sti_hdmi_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, hdmi);
 
 	drm_bridge_add(&hdmi->bridge);
-	return component_add(&pdev->dev, &sti_hdmi_ops);
+	ret = component_add(&pdev->dev, &sti_hdmi_ops);
+	if (ret)
+		goto remove_bridge;
+	return 0;
 
+ remove_bridge:
+	drm_bridge_remove(&hdmi->bridge);
  release_adapter:
 	i2c_put_adapter(hdmi->ddc_adapt);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-14  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 19:41 [PATCH] drm/sti: hdmi: remove bridge when component_add fails Osama Abdelkader
2026-04-14  7:24 ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox