aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-20 01:41:19 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-20 05:13:58 -0500
commit5b48a5a6dfd44ac80775d94e4ec573f4edda9144 (patch)
tree6b049a67b1dd975c4eae5b41705a74fb461a2f3b
parent2ff49eea9b8a1d92c2ab09d803dfdc06f4f8e74b (diff)
ASoC: Convert ak4671 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/ak4671.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c
index 4f5c69f735a9..a53b152e6a07 100644
--- a/sound/soc/codecs/ak4671.c
+++ b/sound/soc/codecs/ak4671.c
@@ -661,7 +661,8 @@ static int __devinit ak4671_i2c_probe(struct i2c_client *client,
661 struct ak4671_priv *ak4671; 661 struct ak4671_priv *ak4671;
662 int ret; 662 int ret;
663 663
664 ak4671 = kzalloc(sizeof(struct ak4671_priv), GFP_KERNEL); 664 ak4671 = devm_kzalloc(&client->dev, sizeof(struct ak4671_priv),
665 GFP_KERNEL);
665 if (ak4671 == NULL) 666 if (ak4671 == NULL)
666 return -ENOMEM; 667 return -ENOMEM;
667 668
@@ -670,15 +671,12 @@ static int __devinit ak4671_i2c_probe(struct i2c_client *client,
670 671
671 ret = snd_soc_register_codec(&client->dev, 672 ret = snd_soc_register_codec(&client->dev,
672 &soc_codec_dev_ak4671, &ak4671_dai, 1); 673 &soc_codec_dev_ak4671, &ak4671_dai, 1);
673 if (ret < 0)
674 kfree(ak4671);
675 return ret; 674 return ret;
676} 675}
677 676
678static __devexit int ak4671_i2c_remove(struct i2c_client *client) 677static __devexit int ak4671_i2c_remove(struct i2c_client *client)
679{ 678{
680 snd_soc_unregister_codec(&client->dev); 679 snd_soc_unregister_codec(&client->dev);
681 kfree(i2c_get_clientdata(client));
682 return 0; 680 return 0;
683} 681}
684 682