drm: sti: make driver use devm_of_platform_populate()
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Fri, 24 Feb 2017 16:14:34 +0000 (17:14 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 27 Feb 2017 16:20:29 +0000 (17:20 +0100)
This make sure that of_platform_depopulate() is called if an error
occur in probe after populating the date from the device tree.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1487952874-23635-3-git-send-email-benjamin.gaignard@linaro.org
drivers/gpu/drm/sti/sti_drv.c

index 3114f125b86392b0b5b2a0c2cb9ea959716e4732..3b15c2cb2306a3ef07c17f0421aa0945709f0afc 100644 (file)
@@ -324,7 +324,7 @@ static int sti_platform_probe(struct platform_device *pdev)
 
        dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
 
-       of_platform_populate(node, NULL, NULL, dev);
+       devm_of_platform_populate(dev);
 
        child_np = of_get_next_available_child(node, NULL);
 
@@ -340,7 +340,6 @@ static int sti_platform_probe(struct platform_device *pdev)
 static int sti_platform_remove(struct platform_device *pdev)
 {
        component_master_del(&pdev->dev, &sti_ops);
-       of_platform_depopulate(&pdev->dev);
 
        return 0;
 }