aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-12-20 01:38:09 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-20 05:13:58 -0500
commit7246492dcf0e56d23f71194f8cd8722a681dfa47 (patch)
tree65117ec6f96a8eeda8d3075c5e82d74c243af596
parent3922d5180ffa605b08c50c13a7c9db68ab6bbc19 (diff)
ASoC: Convert ak4535 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/ak4535.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c
index 96296fd172f9..9e809e05d066 100644
--- a/sound/soc/codecs/ak4535.c
+++ b/sound/soc/codecs/ak4535.c
@@ -416,7 +416,8 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c,
416 struct ak4535_priv *ak4535; 416 struct ak4535_priv *ak4535;
417 int ret; 417 int ret;
418 418
419 ak4535 = kzalloc(sizeof(struct ak4535_priv), GFP_KERNEL); 419 ak4535 = devm_kzalloc(&i2c->dev, sizeof(struct ak4535_priv),
420 GFP_KERNEL);
420 if (ak4535 == NULL) 421 if (ak4535 == NULL)
421 return -ENOMEM; 422 return -ENOMEM;
422 423
@@ -425,15 +426,12 @@ static __devinit int ak4535_i2c_probe(struct i2c_client *i2c,
425 426
426 ret = snd_soc_register_codec(&i2c->dev, 427 ret = snd_soc_register_codec(&i2c->dev,
427 &soc_codec_dev_ak4535, &ak4535_dai, 1); 428 &soc_codec_dev_ak4535, &ak4535_dai, 1);
428 if (ret < 0)
429 kfree(ak4535);
430 return ret; 429 return ret;
431} 430}
432 431
433static __devexit int ak4535_i2c_remove(struct i2c_client *client) 432static __devexit int ak4535_i2c_remove(struct i2c_client *client)
434{ 433{
435 snd_soc_unregister_codec(&client->dev); 434 snd_soc_unregister_codec(&client->dev);
436 kfree(i2c_get_clientdata(client));
437 return 0; 435 return 0;
438} 436}
439 437