All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ASoC: Convert ak4104 to devm_kzalloc()
@ 2011-12-20  6:37 Axel Lin
  2011-12-20  6:38 ` [PATCH 2/5] ASoC: Convert ak4535 " Axel Lin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Axel Lin @ 2011-12-20  6:37 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood, Daniel Mack, Lars-Peter Clausen

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-12-20  6:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20  6:37 [PATCH 1/5] ASoC: Convert ak4104 to devm_kzalloc() Axel Lin
2011-12-20  6:38 ` [PATCH 2/5] ASoC: Convert ak4535 " 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

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.