aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic26.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-29 12:08:36 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-02 12:28:12 +0000
commita8163023d29c1439a2447f5203694bef3ed1c61c (patch)
treea1ed14ebc59615c02bf7974633dab20aa7597ff8 /sound/soc/codecs/tlv320aic26.c
parent099830608a04a7194d00228084bb08130f761084 (diff)
downloadkernel_goldelico_gta04-a8163023d29c1439a2447f5203694bef3ed1c61c.zip
kernel_goldelico_gta04-a8163023d29c1439a2447f5203694bef3ed1c61c.tar.gz
kernel_goldelico_gta04-a8163023d29c1439a2447f5203694bef3ed1c61c.tar.bz2
ASoC: Convert tlv320aic26 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/tlv320aic26.c')
-rw-r--r--sound/soc/codecs/tlv320aic26.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index 86d1fa3..a038dae 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -416,7 +416,7 @@ static int aic26_spi_probe(struct spi_device *spi)
dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n");
/* Allocate driver data */
- aic26 = kzalloc(sizeof *aic26, GFP_KERNEL);
+ aic26 = devm_kzalloc(&spi->dev, sizeof *aic26, GFP_KERNEL);
if (!aic26)
return -ENOMEM;
@@ -427,18 +427,12 @@ static int aic26_spi_probe(struct spi_device *spi)
ret = snd_soc_register_codec(&spi->dev,
&aic26_soc_codec_dev, &aic26_dai, 1);
- if (ret < 0)
- kfree(aic26);
return ret;
-
- dev_dbg(&spi->dev, "SPI device initialized\n");
- return 0;
}
static int aic26_spi_remove(struct spi_device *spi)
{
snd_soc_unregister_codec(&spi->dev);
- kfree(spi_get_drvdata(spi));
return 0;
}