diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 05:59:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-03 05:59:32 -0500 |
commit | 2950cd2208174af9be430f6b6f1507d429c366ca (patch) | |
tree | 341f5faed1ad6a78861d315a576de3dc6b3e49b5 /sound/soc/codecs/wm8903.c | |
parent | 33e57f221a333efa55786f4c3610c7c82b358808 (diff) |
ASoC: Convert WM8903 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r-- | sound/soc/codecs/wm8903.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 60ad8cdc046c..12eedaf938d7 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c | |||
@@ -2079,7 +2079,8 @@ static __devinit int wm8903_i2c_probe(struct i2c_client *i2c, | |||
2079 | struct wm8903_priv *wm8903; | 2079 | struct wm8903_priv *wm8903; |
2080 | int ret; | 2080 | int ret; |
2081 | 2081 | ||
2082 | wm8903 = kzalloc(sizeof(struct wm8903_priv), GFP_KERNEL); | 2082 | wm8903 = devm_kzalloc(&i2c->dev, sizeof(struct wm8903_priv), |
2083 | GFP_KERNEL); | ||
2083 | if (wm8903 == NULL) | 2084 | if (wm8903 == NULL) |
2084 | return -ENOMEM; | 2085 | return -ENOMEM; |
2085 | 2086 | ||
@@ -2088,15 +2089,13 @@ static __devinit int wm8903_i2c_probe(struct i2c_client *i2c, | |||
2088 | 2089 | ||
2089 | ret = snd_soc_register_codec(&i2c->dev, | 2090 | ret = snd_soc_register_codec(&i2c->dev, |
2090 | &soc_codec_dev_wm8903, &wm8903_dai, 1); | 2091 | &soc_codec_dev_wm8903, &wm8903_dai, 1); |
2091 | if (ret < 0) | 2092 | |
2092 | kfree(wm8903); | ||
2093 | return ret; | 2093 | return ret; |
2094 | } | 2094 | } |
2095 | 2095 | ||
2096 | static __devexit int wm8903_i2c_remove(struct i2c_client *client) | 2096 | static __devexit int wm8903_i2c_remove(struct i2c_client *client) |
2097 | { | 2097 | { |
2098 | snd_soc_unregister_codec(&client->dev); | 2098 | snd_soc_unregister_codec(&client->dev); |
2099 | kfree(i2c_get_clientdata(client)); | ||
2100 | return 0; | 2099 | return 0; |
2101 | } | 2100 | } |
2102 | 2101 | ||