aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/lm4857.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/lm4857.c')
-rw-r--r--sound/soc/codecs/lm4857.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sound/soc/codecs/lm4857.c b/sound/soc/codecs/lm4857.c
index c387dafc6ab6..319039240e0f 100644
--- a/sound/soc/codecs/lm4857.c
+++ b/sound/soc/codecs/lm4857.c
@@ -215,7 +215,7 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c,
215 struct lm4857 *lm4857; 215 struct lm4857 *lm4857;
216 int ret; 216 int ret;
217 217
218 lm4857 = kzalloc(sizeof(*lm4857), GFP_KERNEL); 218 lm4857 = devm_kzalloc(&i2c->dev, sizeof(*lm4857), GFP_KERNEL);
219 if (!lm4857) 219 if (!lm4857)
220 return -ENOMEM; 220 return -ENOMEM;
221 221
@@ -225,21 +225,12 @@ static int __devinit lm4857_i2c_probe(struct i2c_client *i2c,
225 225
226 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_lm4857, NULL, 0); 226 ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_lm4857, NULL, 0);
227 227
228 if (ret) { 228 return ret;
229 kfree(lm4857);
230 return ret;
231 }
232
233 return 0;
234} 229}
235 230
236static int __devexit lm4857_i2c_remove(struct i2c_client *i2c) 231static int __devexit lm4857_i2c_remove(struct i2c_client *i2c)
237{ 232{
238 struct lm4857 *lm4857 = i2c_get_clientdata(i2c);
239
240 snd_soc_unregister_codec(&i2c->dev); 233 snd_soc_unregister_codec(&i2c->dev);
241 kfree(lm4857);
242
243 return 0; 234 return 0;
244} 235}
245 236