diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-26 07:52:13 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-28 12:22:40 -0500 |
commit | 80c2f9da4ecba2ba2ab65ddc058190b1be28d9e5 (patch) | |
tree | 07d717d7ef1409936b412d1f6757b8f082acfae9 | |
parent | 30c88f2ca89d6c0706ab585beca3730c9d7524de (diff) |
ASoC: Convert adau1373 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/adau1373.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c index 637b114bea7f..971ba4529171 100644 --- a/sound/soc/codecs/adau1373.c +++ b/sound/soc/codecs/adau1373.c | |||
@@ -1360,7 +1360,7 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, | |||
1360 | struct adau1373 *adau1373; | 1360 | struct adau1373 *adau1373; |
1361 | int ret; | 1361 | int ret; |
1362 | 1362 | ||
1363 | adau1373 = kzalloc(sizeof(*adau1373), GFP_KERNEL); | 1363 | adau1373 = devm_kzalloc(&client->dev, sizeof(*adau1373), GFP_KERNEL); |
1364 | if (!adau1373) | 1364 | if (!adau1373) |
1365 | return -ENOMEM; | 1365 | return -ENOMEM; |
1366 | 1366 | ||
@@ -1368,16 +1368,12 @@ static int __devinit adau1373_i2c_probe(struct i2c_client *client, | |||
1368 | 1368 | ||
1369 | ret = snd_soc_register_codec(&client->dev, &adau1373_codec_driver, | 1369 | ret = snd_soc_register_codec(&client->dev, &adau1373_codec_driver, |
1370 | adau1373_dai_driver, ARRAY_SIZE(adau1373_dai_driver)); | 1370 | adau1373_dai_driver, ARRAY_SIZE(adau1373_dai_driver)); |
1371 | if (ret < 0) | ||
1372 | kfree(adau1373); | ||
1373 | |||
1374 | return ret; | 1371 | return ret; |
1375 | } | 1372 | } |
1376 | 1373 | ||
1377 | static int __devexit adau1373_i2c_remove(struct i2c_client *client) | 1374 | static int __devexit adau1373_i2c_remove(struct i2c_client *client) |
1378 | { | 1375 | { |
1379 | snd_soc_unregister_codec(&client->dev); | 1376 | snd_soc_unregister_codec(&client->dev); |
1380 | kfree(dev_get_drvdata(&client->dev)); | ||
1381 | return 0; | 1377 | return 0; |
1382 | } | 1378 | } |
1383 | 1379 | ||