diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-28 23:07:30 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-02 07:28:12 -0500 |
commit | 099830608a04a7194d00228084bb08130f761084 (patch) | |
tree | 9bbb11859a36157c5990237268df172c74339dea /sound/soc/codecs | |
parent | d999c021b64289b571e5d295deade44e40cbcc4f (diff) |
ASoC: Convert tlv320aic23 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')
-rw-r--r-- | sound/soc/codecs/tlv320aic23.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index 60d08aeac22a..dfa41a96599b 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c | |||
@@ -634,7 +634,7 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c, | |||
634 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 634 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
635 | return -EINVAL; | 635 | return -EINVAL; |
636 | 636 | ||
637 | aic23 = kzalloc(sizeof(struct aic23), GFP_KERNEL); | 637 | aic23 = devm_kzalloc(&i2c->dev, sizeof(struct aic23), GFP_KERNEL); |
638 | if (aic23 == NULL) | 638 | if (aic23 == NULL) |
639 | return -ENOMEM; | 639 | return -ENOMEM; |
640 | 640 | ||
@@ -643,14 +643,11 @@ static int tlv320aic23_codec_probe(struct i2c_client *i2c, | |||
643 | 643 | ||
644 | ret = snd_soc_register_codec(&i2c->dev, | 644 | ret = snd_soc_register_codec(&i2c->dev, |
645 | &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1); | 645 | &soc_codec_dev_tlv320aic23, &tlv320aic23_dai, 1); |
646 | if (ret < 0) | ||
647 | kfree(aic23); | ||
648 | return ret; | 646 | return ret; |
649 | } | 647 | } |
650 | static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c) | 648 | static int __exit tlv320aic23_i2c_remove(struct i2c_client *i2c) |
651 | { | 649 | { |
652 | snd_soc_unregister_codec(&i2c->dev); | 650 | snd_soc_unregister_codec(&i2c->dev); |
653 | kfree(i2c_get_clientdata(i2c)); | ||
654 | return 0; | 651 | return 0; |
655 | } | 652 | } |
656 | 653 | ||