lkml.org 
[lkml]   [2014]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ASoC: core: Use devm_kzalloc() instead kzalloc()
Date
Makes the code slightly shorter

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
sound/soc/soc-generic-dmaengine-pcm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index 5bace12..bfb012f 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -388,7 +388,7 @@ int snd_dmaengine_pcm_register(struct device *dev,
struct dmaengine_pcm *pcm;
int ret;

- pcm = kzalloc(sizeof(*pcm), GFP_KERNEL);
+ pcm = devm_kzalloc(dev, sizeof(*pcm), GFP_KERNEL);
if (!pcm)
return -ENOMEM;

@@ -408,7 +408,6 @@ int snd_dmaengine_pcm_register(struct device *dev,

err_free_dma:
dmaengine_pcm_release_chan(pcm);
- kfree(pcm);
return ret;
}
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_register);
@@ -433,7 +432,6 @@ void snd_dmaengine_pcm_unregister(struct device *dev)

snd_soc_remove_platform(platform);
dmaengine_pcm_release_chan(pcm);
- kfree(pcm);
}
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_unregister);

--
1.8.4



\
 
 \ /
  Last update: 2014-01-16 12:01    [W:0.115 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site