aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-11 21:25:59 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-11 21:36:44 -0400
commit398c02f6c213c5d0a791ebf9517b6e7029dc5cf0 (patch)
tree916b2902bc857b48d529672a793e1e8fe6adfe66
parent3217b0f5b6fd91440fd72cf24a8986b3f99d0d84 (diff)
ASoC: wm8580: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm8580.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index 7c68226376e4..cc198df15e6e 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -899,7 +899,8 @@ static int wm8580_i2c_probe(struct i2c_client *i2c,
899 struct wm8580_priv *wm8580; 899 struct wm8580_priv *wm8580;
900 int ret; 900 int ret;
901 901
902 wm8580 = kzalloc(sizeof(struct wm8580_priv), GFP_KERNEL); 902 wm8580 = devm_kzalloc(&i2c->dev, sizeof(struct wm8580_priv),
903 GFP_KERNEL);
903 if (wm8580 == NULL) 904 if (wm8580 == NULL)
904 return -ENOMEM; 905 return -ENOMEM;
905 906
@@ -908,15 +909,13 @@ static int wm8580_i2c_probe(struct i2c_client *i2c,
908 909
909 ret = snd_soc_register_codec(&i2c->dev, 910 ret = snd_soc_register_codec(&i2c->dev,
910 &soc_codec_dev_wm8580, wm8580_dai, ARRAY_SIZE(wm8580_dai)); 911 &soc_codec_dev_wm8580, wm8580_dai, ARRAY_SIZE(wm8580_dai));
911 if (ret < 0) 912
912 kfree(wm8580);
913 return ret; 913 return ret;
914} 914}
915 915
916static int wm8580_i2c_remove(struct i2c_client *client) 916static int wm8580_i2c_remove(struct i2c_client *client)
917{ 917{
918 snd_soc_unregister_codec(&client->dev); 918 snd_soc_unregister_codec(&client->dev);
919 kfree(i2c_get_clientdata(client));
920 return 0; 919 return 0;
921} 920}
922 921