drm/sti: remove bridge when sti_hda component_add fails
Subsystems (7)
PATCH 1/3 drm/sti: remove bridge when sti_hda component_add fails
when component_add fails in sti_hda_probe remove drm bridge before return
--- drivers/gpu/drm/sti/sti_hda.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_hda.c +5 -1
@@ -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)
Signature · 1 line
2.43.0
PATCH 2/3 drm/exynos: remove bridge when component_add fails
when component_add fails in exynos_mic_probe remove drm bridge before return
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/exynos/exynos_drm_mic.c +1 -0
@@ -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; }
Signature · 1 line
2.43.0
PATCH 3/3 drm/bridge: megachips: remove bridge when irq request fails
In reply to Osama Abdelkaderwhen devm_request_threaded_irq fails in ge_b850v3_register remove drm bridge before return
--- drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +5 -1
@@ -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)
Signature · 1 line
2.43.0
Luca Ceresoli
reviewerQuoted 21 lines · Osama Abdelkader
when
component_addfails insti_hda_proberemove drm bridge before returnSigned-off-by Osama Abdelkader <[email protected]>--- drivers/gpu/drm/sti/sti_hda.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/sti/sti_hda.c +1
-0@@ -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__);
drivers/gpu/drm/sti/sti_hda.c static int sti_hda_probe(struct platform_device *pdev) · line 791
Quoted 9 lines
drivers/gpu/drm/sti/sti_hda.c +4
-1@@ -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