aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-11 21:28:08 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-11 21:36:50 -0400
commit046d4f02e8835ff78f8ba5a09e358b2bc4832903 (patch)
tree54f3c4971552c64f248751cf4692e8b488a2e047
parent587cbbb36ef2657cd888b7705e02cfe96ab088b7 (diff)
ASoC: wm8991: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm8991.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index b9dbfebbda13..fe439f027e10 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -1363,7 +1363,7 @@ static __devinit int wm8991_i2c_probe(struct i2c_client *i2c,
1363 struct wm8991_priv *wm8991; 1363 struct wm8991_priv *wm8991;
1364 int ret; 1364 int ret;
1365 1365
1366 wm8991 = kzalloc(sizeof *wm8991, GFP_KERNEL); 1366 wm8991 = devm_kzalloc(&i2c->dev, sizeof(*wm8991), GFP_KERNEL);
1367 if (!wm8991) 1367 if (!wm8991)
1368 return -ENOMEM; 1368 return -ENOMEM;
1369 1369
@@ -1372,15 +1372,14 @@ static __devinit int wm8991_i2c_probe(struct i2c_client *i2c,
1372 1372
1373 ret = snd_soc_register_codec(&i2c->dev, 1373 ret = snd_soc_register_codec(&i2c->dev,
1374 &soc_codec_dev_wm8991, &wm8991_dai, 1); 1374 &soc_codec_dev_wm8991, &wm8991_dai, 1);
1375 if (ret < 0) 1375
1376 kfree(wm8991);
1377 return ret; 1376 return ret;
1378} 1377}
1379 1378
1380static __devexit int wm8991_i2c_remove(struct i2c_client *client) 1379static __devexit int wm8991_i2c_remove(struct i2c_client *client)
1381{ 1380{
1382 snd_soc_unregister_codec(&client->dev); 1381 snd_soc_unregister_codec(&client->dev);
1383 kfree(i2c_get_clientdata(client)); 1382
1384 return 0; 1383 return 0;
1385} 1384}
1386 1385