From: Xiubo Li <Li.Xiubo@freescale.com>
To: <lars@metafoo.de>, <lgirdwood@gmail.com>, <broonie@kernel.org>,
<perex@perex.cz>, <tiwai@suse.de>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
Xiubo Li <Li.Xiubo@freescale.com>
Subject: [PATCH] ASoC: core: Use devm_kzalloc() instead kzalloc()
Date: Thu, 16 Jan 2014 16:44:47 +0800 [thread overview]
Message-ID: <1389861887-32721-1-git-send-email-Li.Xiubo@freescale.com> (raw)
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
next reply other threads:[~2014-01-16 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-16 8:44 Xiubo Li [this message]
2014-01-16 21:52 ` [alsa-devel] " Lars-Peter Clausen
2014-01-17 18:48 ` Mark Brown
2014-01-20 3:18 ` Li.Xiubo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389861887-32721-1-git-send-email-Li.Xiubo@freescale.com \
--to=li.xiubo@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®