dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev.
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 2 Nov 2013 12:58:29 +0000 (12:58 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 3 Apr 2014 23:27:09 +0000 (00:27 +0100)
Use devm_kzalloc() to allocate omap_dmadev() so that we don't need
complex error cleanup paths.

Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/dma/omap-dma.c

index 362e7c49f2e1ad9d264eef1acff1b3102f0e1212..98034e8c558ff70559529cdf110271e0ddb2b4bd 100644 (file)
@@ -594,7 +594,6 @@ static void omap_dma_free(struct omap_dmadev *od)
                tasklet_kill(&c->vc.task);
                kfree(c);
        }
-       kfree(od);
 }
 
 static int omap_dma_probe(struct platform_device *pdev)
@@ -602,7 +601,7 @@ static int omap_dma_probe(struct platform_device *pdev)
        struct omap_dmadev *od;
        int rc, i;
 
-       od = kzalloc(sizeof(*od), GFP_KERNEL);
+       od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
        if (!od)
                return -ENOMEM;