diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-28 23:01:07 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-02 07:28:11 -0500 |
commit | 49ba7673243013103bde4706c506bda2c631a39b (patch) | |
tree | 39e302e10db4f67548c4ff327a6e38d736701ab4 /sound/soc/codecs/max98088.c | |
parent | 021b918efb204b1deda7cfc7edef2972d98ffc46 (diff) |
ASoC: Convert max98088 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r-- | sound/soc/codecs/max98088.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index ba4f6f167a1..006efcfe6dd 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -2069,7 +2069,8 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2069 | struct max98088_priv *max98088; | 2069 | struct max98088_priv *max98088; |
2070 | int ret; | 2070 | int ret; |
2071 | 2071 | ||
2072 | max98088 = kzalloc(sizeof(struct max98088_priv), GFP_KERNEL); | 2072 | max98088 = devm_kzalloc(&i2c->dev, sizeof(struct max98088_priv), |
2073 | GFP_KERNEL); | ||
2073 | if (max98088 == NULL) | 2074 | if (max98088 == NULL) |
2074 | return -ENOMEM; | 2075 | return -ENOMEM; |
2075 | 2076 | ||
@@ -2080,15 +2081,12 @@ static int max98088_i2c_probe(struct i2c_client *i2c, | |||
2080 | 2081 | ||
2081 | ret = snd_soc_register_codec(&i2c->dev, | 2082 | ret = snd_soc_register_codec(&i2c->dev, |
2082 | &soc_codec_dev_max98088, &max98088_dai[0], 2); | 2083 | &soc_codec_dev_max98088, &max98088_dai[0], 2); |
2083 | if (ret < 0) | ||
2084 | kfree(max98088); | ||
2085 | return ret; | 2084 | return ret; |
2086 | } | 2085 | } |
2087 | 2086 | ||
2088 | static int __devexit max98088_i2c_remove(struct i2c_client *client) | 2087 | static int __devexit max98088_i2c_remove(struct i2c_client *client) |
2089 | { | 2088 | { |
2090 | snd_soc_unregister_codec(&client->dev); | 2089 | snd_soc_unregister_codec(&client->dev); |
2091 | kfree(i2c_get_clientdata(client)); | ||
2092 | return 0; | 2090 | return 0; |
2093 | } | 2091 | } |
2094 | 2092 | ||