alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>,
	Mark@alsa-project.org
Subject: [PATCH 10/10] ASoC: Convert uda1380 to devm_kzalloc()
Date: Mon, 26 Dec 2011 20:58:14 +0800	[thread overview]
Message-ID: <1324904294.26543.11.camel@phoenix> (raw)
In-Reply-To: <1324903728.26543.1.camel@phoenix>

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/uda1380.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 8f734d6..4f1b23d 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -803,7 +803,8 @@ static __devinit int uda1380_i2c_probe(struct i2c_client *i2c,
 	struct uda1380_priv *uda1380;
 	int ret;
 
-	uda1380 = kzalloc(sizeof(struct uda1380_priv), GFP_KERNEL);
+	uda1380 = devm_kzalloc(&i2c->dev, sizeof(struct uda1380_priv),
+			       GFP_KERNEL);
 	if (uda1380 == NULL)
 		return -ENOMEM;
 
@@ -812,15 +813,12 @@ static __devinit int uda1380_i2c_probe(struct i2c_client *i2c,
 
 	ret =  snd_soc_register_codec(&i2c->dev,
 			&soc_codec_dev_uda1380, uda1380_dai, ARRAY_SIZE(uda1380_dai));
-	if (ret < 0)
-		kfree(uda1380);
 	return ret;
 }
 
 static int __devexit uda1380_i2c_remove(struct i2c_client *i2c)
 {
 	snd_soc_unregister_codec(&i2c->dev);
-	kfree(i2c_get_clientdata(i2c));
 	return 0;
 }
 
-- 
1.7.5.4

  parent reply	other threads:[~2011-12-26 12:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-26 12:48 [PATCH 01/10] ASoC: Convert 88pm860x-codec to devm_kzalloc() Axel Lin
2011-12-26 12:50 ` [PATCH 02/10] ASoC: Convert ad1836 " Axel Lin
2011-12-28 17:22   ` Mark Brown
2011-12-26 12:51 ` [PATCH 03/10] ASoC: Convert ad193x " Axel Lin
2011-12-26 12:52 ` [PATCH 04/10] ASoC: Convert adau1373 " Axel Lin
2011-12-26 12:53 ` [PATCH 05/10] ASoC: Convert adau1701 " Axel Lin
2011-12-26 12:54 ` [PATCH 06/10] ASoC: Convert da7210 " Axel Lin
2011-12-27 12:58   ` Mark Brown
2011-12-26 12:55 ` [PATCH 07/10] ASoC: Convert jz4740 " Axel Lin
2011-12-26 12:56 ` [PATCH 08/10] ASoC: Convert lm4857 " Axel Lin
2011-12-27 12:59   ` Mark Brown
2011-12-26 12:57 ` [PATCH 09/10] ASoC: Convert tlv320aic32x4 " Axel Lin
2011-12-26 12:58 ` Axel Lin [this message]
2011-12-27 12:59   ` [PATCH 10/10] ASoC: Convert uda1380 " Mark Brown
2011-12-27 12:58 ` [PATCH 01/10] ASoC: Convert 88pm860x-codec " Mark Brown

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=1324904294.26543.11.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=Mark@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).