提交 104fce73 编写于 作者: R Russell King

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: NTony Lindgren <tony@atomide.com>
Acked-by: NVinod Koul <vinod.koul@intel.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 b28a960c
...@@ -594,7 +594,6 @@ static void omap_dma_free(struct omap_dmadev *od) ...@@ -594,7 +594,6 @@ static void omap_dma_free(struct omap_dmadev *od)
tasklet_kill(&c->vc.task); tasklet_kill(&c->vc.task);
kfree(c); kfree(c);
} }
kfree(od);
} }
static int omap_dma_probe(struct platform_device *pdev) static int omap_dma_probe(struct platform_device *pdev)
...@@ -602,7 +601,7 @@ 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; struct omap_dmadev *od;
int rc, i; int rc, i;
od = kzalloc(sizeof(*od), GFP_KERNEL); od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
if (!od) if (!od)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册