Commit a8163023 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert tlv320aic26 to devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 09983060
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment