diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-29 06:04:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-20 08:58:21 -0500 |
commit | 028b0a0a92daa36bd9e0f6d01954fe67c969a095 (patch) | |
tree | b015a18d6999ed11d311afb24965b0a000b6915a | |
parent | c4850644ceaeb4fb6be3bd3305afc995a0f46a6c (diff) |
ASoC: Convert wm8971 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8971.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c index 3a5d67c59a2d..28fe59e3ce01 100644 --- a/sound/soc/codecs/wm8971.c +++ b/sound/soc/codecs/wm8971.c | |||
@@ -686,7 +686,8 @@ static __devinit int wm8971_i2c_probe(struct i2c_client *i2c, | |||
686 | struct wm8971_priv *wm8971; | 686 | struct wm8971_priv *wm8971; |
687 | int ret; | 687 | int ret; |
688 | 688 | ||
689 | wm8971 = kzalloc(sizeof(struct wm8971_priv), GFP_KERNEL); | 689 | wm8971 = devm_kzalloc(&i2c->dev, sizeof(struct wm8971_priv), |
690 | GFP_KERNEL); | ||
690 | if (wm8971 == NULL) | 691 | if (wm8971 == NULL) |
691 | return -ENOMEM; | 692 | return -ENOMEM; |
692 | 693 | ||
@@ -695,15 +696,13 @@ static __devinit int wm8971_i2c_probe(struct i2c_client *i2c, | |||
695 | 696 | ||
696 | ret = snd_soc_register_codec(&i2c->dev, | 697 | ret = snd_soc_register_codec(&i2c->dev, |
697 | &soc_codec_dev_wm8971, &wm8971_dai, 1); | 698 | &soc_codec_dev_wm8971, &wm8971_dai, 1); |
698 | if (ret < 0) | 699 | |
699 | kfree(wm8971); | ||
700 | return ret; | 700 | return ret; |
701 | } | 701 | } |
702 | 702 | ||
703 | static __devexit int wm8971_i2c_remove(struct i2c_client *client) | 703 | static __devexit int wm8971_i2c_remove(struct i2c_client *client) |
704 | { | 704 | { |
705 | snd_soc_unregister_codec(&client->dev); | 705 | snd_soc_unregister_codec(&client->dev); |
706 | kfree(i2c_get_clientdata(client)); | ||
707 | return 0; | 706 | return 0; |
708 | } | 707 | } |
709 | 708 | ||