diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-11-02 08:58:29 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-03 19:27:09 -0400 |
commit | 104fce73fdbd174eb08a493eeb2920fd59e6d3f4 (patch) | |
tree | 756279a6a316021201c6e1dc4db56d0086fb5165 | |
parent | b28a960c42fcd9cfc987441fa6d1c1a471f0f9ed (diff) |
dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev.
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>
-rw-r--r-- | drivers/dma/omap-dma.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c index 362e7c49f2e1..98034e8c558f 100644 --- a/drivers/dma/omap-dma.c +++ b/drivers/dma/omap-dma.c | |||
@@ -594,7 +594,6 @@ static void omap_dma_free(struct omap_dmadev *od) | |||
594 | tasklet_kill(&c->vc.task); | 594 | tasklet_kill(&c->vc.task); |
595 | kfree(c); | 595 | kfree(c); |
596 | } | 596 | } |
597 | kfree(od); | ||
598 | } | 597 | } |
599 | 598 | ||
600 | static int omap_dma_probe(struct platform_device *pdev) | 599 | static int omap_dma_probe(struct platform_device *pdev) |
@@ -602,7 +601,7 @@ static int omap_dma_probe(struct platform_device *pdev) | |||
602 | struct omap_dmadev *od; | 601 | struct omap_dmadev *od; |
603 | int rc, i; | 602 | int rc, i; |
604 | 603 | ||
605 | od = kzalloc(sizeof(*od), GFP_KERNEL); | 604 | od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL); |
606 | if (!od) | 605 | if (!od) |
607 | return -ENOMEM; | 606 | return -ENOMEM; |
608 | 607 | ||