aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-10 04:18:56 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-10 05:25:41 -0400
commit7d014db8baf70bcc7e9cf1457350b11bc2affbbd (patch)
tree093c8a86fde9de6cfb683a9c3a82f9565bd5013e
parent2ee01ac63b72a3101d6293b50d70d830959bbe8f (diff)
ASoC: wm8523: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm8523.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8523.c b/sound/soc/codecs/wm8523.c
index 1c3ffb290cdc..af2289ee6cd6 100644
--- a/sound/soc/codecs/wm8523.c
+++ b/sound/soc/codecs/wm8523.c
@@ -516,7 +516,8 @@ static __devinit int wm8523_i2c_probe(struct i2c_client *i2c,
516 struct wm8523_priv *wm8523; 516 struct wm8523_priv *wm8523;
517 int ret; 517 int ret;
518 518
519 wm8523 = kzalloc(sizeof(struct wm8523_priv), GFP_KERNEL); 519 wm8523 = devm_kzalloc(&i2c->dev, sizeof(struct wm8523_priv),
520 GFP_KERNEL);
520 if (wm8523 == NULL) 521 if (wm8523 == NULL)
521 return -ENOMEM; 522 return -ENOMEM;
522 523
@@ -525,8 +526,7 @@ static __devinit int wm8523_i2c_probe(struct i2c_client *i2c,
525 526
526 ret = snd_soc_register_codec(&i2c->dev, 527 ret = snd_soc_register_codec(&i2c->dev,
527 &soc_codec_dev_wm8523, &wm8523_dai, 1); 528 &soc_codec_dev_wm8523, &wm8523_dai, 1);
528 if (ret < 0) 529
529 kfree(wm8523);
530 return ret; 530 return ret;
531 531
532} 532}
@@ -534,7 +534,6 @@ static __devinit int wm8523_i2c_probe(struct i2c_client *i2c,
534static __devexit int wm8523_i2c_remove(struct i2c_client *client) 534static __devexit int wm8523_i2c_remove(struct i2c_client *client)
535{ 535{
536 snd_soc_unregister_codec(&client->dev); 536 snd_soc_unregister_codec(&client->dev);
537 kfree(i2c_get_clientdata(client));
538 return 0; 537 return 0;
539} 538}
540 539