From: Axel Lin <axel.lin@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>, Daniel Mack <daniel@caiaq.de>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 1/5] ASoC: Convert ak4104 to devm_kzalloc()
Date: Tue, 20 Dec 2011 14:37:12 +0800 [thread overview]
Message-ID: <1324363032.5632.1.camel@phoenix> (raw)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
sound/soc/codecs/ak4104.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
index 152420c..d27b5e4 100644
--- a/sound/soc/codecs/ak4104.c
+++ b/sound/soc/codecs/ak4104.c
@@ -261,7 +261,8 @@ static int ak4104_spi_probe(struct spi_device *spi)
if (ret < 0)
return ret;
- ak4104 = kzalloc(sizeof(struct ak4104_private), GFP_KERNEL);
+ ak4104 = devm_kzalloc(&spi->dev, sizeof(struct ak4104_private),
+ GFP_KERNEL);
if (ak4104 == NULL)
return -ENOMEM;
@@ -271,15 +272,12 @@ static int ak4104_spi_probe(struct spi_device *spi)
ret = snd_soc_register_codec(&spi->dev,
&soc_codec_device_ak4104, &ak4104_dai, 1);
- if (ret < 0)
- kfree(ak4104);
return ret;
}
static int __devexit ak4104_spi_remove(struct spi_device *spi)
{
snd_soc_unregister_codec(&spi->dev);
- kfree(spi_get_drvdata(spi));
return 0;
}
--
1.7.5.4
next reply other threads:[~2011-12-20 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-20 6:37 Axel Lin [this message]
2011-12-20 6:38 ` [PATCH 2/5] ASoC: Convert ak4535 to devm_kzalloc() Axel Lin
2011-12-20 6:39 ` [PATCH 3/5] ASoC: Convert ak4641 " Axel Lin
2011-12-20 6:40 ` [PATCH 4/5] ASoC: Convert ak4642 " Axel Lin
2011-12-20 6:41 ` [PATCH 5/5] ASoC: Convert ak4671 " Axel Lin
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=1324363032.5632.1.camel@phoenix \
--to=axel.lin@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=daniel@caiaq.de \
--cc=lars@metafoo.de \
--cc=lrg@ti.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.