public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails
@ 2026-04-10 21:27 Osama Abdelkader
  2026-04-10 21:27 ` [PATCH 2/3] drm/exynos: remove bridge when " Osama Abdelkader
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Osama Abdelkader @ 2026-04-10 21:27 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_hda_probe remove drm
bridge before return

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

diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
index b7397827889c..1b4ba9097005 100644
--- a/drivers/gpu/drm/sti/sti_hda.c
+++ b/drivers/gpu/drm/sti/sti_hda.c
@@ -741,6 +741,7 @@ static int sti_hda_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct sti_hda *hda;
 	struct resource *res;
+	int ret;
 
 	DRM_INFO("%s\n", __func__);
 
@@ -783,7 +784,10 @@ static int sti_hda_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, hda);
 
-	return component_add(&pdev->dev, &sti_hda_ops);
+	ret = component_add(&pdev->dev, &sti_hda_ops);
+	if (ret)
+		drm_bridge_remove(&hda->bridge);
+	return ret;
 }
 
 static void sti_hda_remove(struct platform_device *pdev)
-- 
2.43.0


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

* [PATCH 2/3] drm/exynos: remove bridge when component_add fails
  2026-04-10 21:27 [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Osama Abdelkader
@ 2026-04-10 21:27 ` Osama Abdelkader
  2026-04-10 21:27 ` [PATCH 3/3] drm/bridge: megachips: remove bridge when irq request fails Osama Abdelkader
  2026-04-14  7:33 ` [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Luca Ceresoli
  2 siblings, 0 replies; 4+ messages in thread
From: Osama Abdelkader @ 2026-04-10 21:27 UTC (permalink / raw)
  To: luca.ceresoli, Inki Dae, Seung-Woo Kim, Kyungmin Park,
	David Airlie, Simona Vetter, Krzysztof Kozlowski, Alim Akhtar,
	dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel
  Cc: Osama Abdelkader

when component_add fails in exynos_mic_probe remove drm
bridge before return

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/exynos/exynos_drm_mic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c
index 29a8366513fa..5e771b236bf0 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_mic.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c
@@ -437,6 +437,7 @@ static int exynos_mic_probe(struct platform_device *pdev)
 
 err_pm:
 	pm_runtime_disable(dev);
+	drm_bridge_remove(&mic->bridge);
 err:
 	return ret;
 }
-- 
2.43.0


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

* [PATCH 3/3] drm/bridge: megachips: remove bridge when irq request fails
  2026-04-10 21:27 [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Osama Abdelkader
  2026-04-10 21:27 ` [PATCH 2/3] drm/exynos: remove bridge when " Osama Abdelkader
@ 2026-04-10 21:27 ` Osama Abdelkader
  2026-04-14  7:33 ` [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Luca Ceresoli
  2 siblings, 0 replies; 4+ messages in thread
From: Osama Abdelkader @ 2026-04-10 21:27 UTC (permalink / raw)
  To: luca.ceresoli, Peter Senna Tschudin, Ian Ray, Martyn Welch,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, dri-devel,
	linux-kernel
  Cc: Osama Abdelkader

when devm_request_threaded_irq fails in ge_b850v3_register remove
drm bridge before return

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
---
 drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
index c9e6505cbd88..b54b6a9c9307 100644
--- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
+++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
@@ -261,6 +261,7 @@ static int ge_b850v3_register(void)
 {
 	struct i2c_client *stdp4028_i2c = ge_b850v3_lvds_ptr->stdp4028_i2c;
 	struct device *dev = &stdp4028_i2c->dev;
+	int ret;
 
 	/* drm bridge initialization */
 	ge_b850v3_lvds_ptr->bridge.ops = DRM_BRIDGE_OP_DETECT |
@@ -277,11 +278,14 @@ static int ge_b850v3_register(void)
 	if (!stdp4028_i2c->irq)
 		return 0;
 
-	return devm_request_threaded_irq(&stdp4028_i2c->dev,
+	ret = devm_request_threaded_irq(&stdp4028_i2c->dev,
 			stdp4028_i2c->irq, NULL,
 			ge_b850v3_lvds_irq_handler,
 			IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
 			"ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
+	if (ret)
+		drm_bridge_remove(&ge_b850v3_lvds_ptr->bridge);
+	return ret;
 }
 
 static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c)
-- 
2.43.0


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

* Re: [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails
  2026-04-10 21:27 [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Osama Abdelkader
  2026-04-10 21:27 ` [PATCH 2/3] drm/exynos: remove bridge when " Osama Abdelkader
  2026-04-10 21:27 ` [PATCH 3/3] drm/bridge: megachips: remove bridge when irq request fails Osama Abdelkader
@ 2026-04-14  7:33 ` Luca Ceresoli
  2 siblings, 0 replies; 4+ messages in thread
From: Luca Ceresoli @ 2026-04-14  7:33 UTC (permalink / raw)
  To: Osama Abdelkader, Alain Volmat, Raphael Gallais-Pou,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel

On Fri Apr 10, 2026 at 11:27 PM CEST, Osama Abdelkader wrote:
> when component_add fails in sti_hda_probe remove drm
> bridge before return
>
> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> ---
>  drivers/gpu/drm/sti/sti_hda.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c
> index b7397827889c..1b4ba9097005 100644
> --- a/drivers/gpu/drm/sti/sti_hda.c
> +++ b/drivers/gpu/drm/sti/sti_hda.c
> @@ -741,6 +741,7 @@ static int sti_hda_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct sti_hda *hda;
>  	struct resource *res;
> +	int ret;
>
>  	DRM_INFO("%s\n", __func__);
>
> @@ -783,7 +784,10 @@ static int sti_hda_probe(struct platform_device *pdev)
>
>  	platform_set_drvdata(pdev, hda);
>
> -	return component_add(&pdev->dev, &sti_hda_ops);
> +	ret = component_add(&pdev->dev, &sti_hda_ops);
> +	if (ret)
> +		drm_bridge_remove(&hda->bridge);
> +	return ret;
>  }

At a quick look it seems that you can simply use devm_drm_bridge_add() in
all the three drivers in this series.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 21:27 [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Osama Abdelkader
2026-04-10 21:27 ` [PATCH 2/3] drm/exynos: remove bridge when " Osama Abdelkader
2026-04-10 21:27 ` [PATCH 3/3] drm/bridge: megachips: remove bridge when irq request fails Osama Abdelkader
2026-04-14  7:33 ` [PATCH 1/3] drm/sti: remove bridge when sti_hda component_add fails Luca Ceresoli

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