Skip to contentSkip to conversation

drm/omap: dsi: Fix missing of_platform_depopulate()

PATCH In review Tony Lindgren 4 participants 6 messages Nov 6, 2018 – Nov 12, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/omap: dsi: Fix missing of_platform_depopulate()

We're missing a call to of_platform_depopulate() on errors for dsi. Looks like dss is already doing this.

---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/dss/dsi.c +6 -2
@@ -5429,15 +5429,19 @@ static int dsi_probe(struct platform_device *pdev)
 	}
 
 	r = of_platform_populate(dev->of_node, NULL, NULL, dev);
-	if (r)
+	if (r) {
 		DSSERR("Failed to populate DSI child devices: %d\n", r);
+		goto err_uninit_output;
+	}
 
 	r = component_add(&pdev->dev, &dsi_component_ops);
 	if (r)
-		goto err_uninit_output;
+		goto err_of_depopulate;
 
 	return 0;
 
+err_of_depopulate:
+	of_platform_depopulate(dev);
 err_uninit_output:
 	dsi_uninit_output(dsi);
 err_pm_disable:
Signature · 5 lines
2.19.1
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi Tony,

Thank you for the patch.

Quoted 4 lines · On Tuesday, 6 November 2018 17:28:02 EET Tony Lindgren wrote:

We're missing a call to of_platform_depopulate() on errors for dsi. Looks like dss is already doing this.

This makes sense to me. You may however want to note in the commit message that this patch also turns the of_platform_populate() failures into fatal errors.

Quoted 29 lines
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/omapdrm/dss/dsi.c --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c

drivers/gpu/drm/omapdrm/dss/dsi.c +6 -2
@@ -5429,15 +5429,19 @@ static int dsi_probe(struct platform_device *pdev)
 	}
 
 	r = of_platform_populate(dev->of_node, NULL, NULL, dev);
-	if (r)
+	if (r) {
 		DSSERR("Failed to populate DSI child devices: %d\n", r);
+		goto err_uninit_output;
+	}
 
 	r = component_add(&pdev->dev, &dsi_component_ops);
 	if (r)
-		goto err_uninit_output;
+		goto err_of_depopulate;
 
 	return 0;
 
+err_of_depopulate:
+	of_platform_depopulate(dev);
 err_uninit_output:
 	dsi_uninit_output(dsi);
 err_pm_disable:
Signature · 10 lines
Regards,

Laurent Pinchart



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 5 lines · Laurent Pinchart

Hi Tony,

Thank you for the patch.

On Tuesday, 6 November 2018 17:28:02 EET Tony Lindgren wrote:

Quoted 8 lines
Quoted 4 lines

We're missing a call to of_platform_depopulate() on errors for dsi. Looks like dss is already doing this.

This makes sense to me. You may however want to note in the commit message that this patch also turns the of_platform_populate() failures into fatal errors.

Well of_platform_populate() failure should be fatal here,right? :) Tomi, let me know if you need a resend with updated comments or if you want to update the message yourself to your liking.

Regards,

Tony
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Hi Tony,

Quoted 5 lines · On Thursday, 8 November 2018 19:01:45 EET Tony Lindgren wrote:
Quoted 4 lines · Laurent Pinchart
Quoted 3 lines · On Tuesday, 6 November 2018 17:28:02 EET Tony Lindgren wrote:

We're missing a call to of_platform_depopulate() on errors for dsi. Looks like dss is already doing this.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

This makes sense to me. You may however want to note in the commit message that this patch also turns the of_platform_populate() failures into fatal errors.

Well of_platform_populate() failure should be fatal here,right? :)

I'm not complaining about the functional change, just the lack of visibility :-)

Quoted 2 lines

Tomi, let me know if you need a resend with updated comments or if you want to update the message yourself to your liking.

Signature · 10 lines
Regards,

Laurent Pinchart



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#4 lore raw
In reply to Tony Lindgren

Hi,

Quoted 5 lines · Tony Lindgren

We're missing a call to of_platform_depopulate() on errors for dsi. Looks like dss is already doing this.

---

-- Sebastian

Quoted 30 lines
 drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/dss/dsi.c +6 -2
@@ -5429,15 +5429,19 @@ static int dsi_probe(struct platform_device *pdev)
 	}
 
 	r = of_platform_populate(dev->of_node, NULL, NULL, dev);
-	if (r)
+	if (r) {
 		DSSERR("Failed to populate DSI child devices: %d\n", r);
+		goto err_uninit_output;
+	}
 
 	r = component_add(&pdev->dev, &dsi_component_ops);
 	if (r)
-		goto err_uninit_output;
+		goto err_of_depopulate;
 
 	return 0;
 
+err_of_depopulate:
+	of_platform_depopulate(dev);
 err_uninit_output:
 	dsi_uninit_output(dsi);
 err_pm_disable:
Signature · 1 line
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
In reply to Tony Lindgren
Quoted 24 lines · Tony Lindgren

We're missing a call to of_platform_depopulate() on errors for dsi. Looks like dss is already doing this.

---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/dss/dsi.c +3 -1
@@ -5429,15 +5429,19 @@ static int dsi_probe(struct platform_device *pdev)
 	}
 
 	r = of_platform_populate(dev->of_node, NULL, NULL, dev);
-	if (r)
+	if (r) {
 		DSSERR("Failed to populate DSI child devices: %d\n", r);
+		goto err_uninit_output;
+	}
 
 	r = component_add(&pdev->dev, &dsi_component_ops);
 	if (r)

drivers/gpu/drm/omapdrm/dss/dsi.c static int dsi_probe(struct platform_device *pdev) · line 5447

Quoted 10 lines
drivers/gpu/drm/omapdrm/dss/dsi.c +3 -1
-		goto err_uninit_output;
+		goto err_of_depopulate;
 
 	return 0;
 
+err_of_depopulate:
+	of_platform_depopulate(dev);
 err_uninit_output:
 	dsi_uninit_output(dsi);
 err_pm_disable:

Thanks, looks good to me. I'll push to drm-misc-fixes.

Tomi

Signature · 6 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel