diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-03-16 23:06:25 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-18 12:00:27 +0000 |
commit | dac7e40404a6b1e7442c01ef4c2e7e149b9627e5 (patch) | |
tree | fcaaca66ee5ca485b9194386f8b4380ba751c023 | |
parent | fd218aa3e5d4ee522cbfe88ad4dd83eb891096fb (diff) | |
download | linux-dac7e40404a6b1e7442c01ef4c2e7e149b9627e5.tar.gz linux-dac7e40404a6b1e7442c01ef4c2e7e149b9627e5.tar.xz |
ASoC: tlv320aic31xx: Don't call kfree for memory allocated by devm_kzalloc
The kfree call is not necessary, but we need to call snd_soc_unregister_codec()
in remove().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/tlv320aic31xx.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index 1f243c2c98fd..e463ae7fe1f4 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -1229,7 +1229,6 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, return -ENOMEM; aic31xx->regmap = devm_regmap_init_i2c(i2c, regmap_config); - if (IS_ERR(aic31xx->regmap)) { ret = PTR_ERR(aic31xx->regmap); dev_err(&i2c->dev, "Failed to allocate register map: %d\n", @@ -1242,18 +1241,14 @@ static int aic31xx_i2c_probe(struct i2c_client *i2c, aic31xx_device_init(aic31xx); - ret = snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, + return snd_soc_register_codec(&i2c->dev, &soc_codec_driver_aic31xx, aic31xx_dai_driver, ARRAY_SIZE(aic31xx_dai_driver)); - - return ret; } static int aic31xx_i2c_remove(struct i2c_client *i2c) { - struct aic31xx_priv *aic31xx = dev_get_drvdata(&i2c->dev); - - kfree(aic31xx); + snd_soc_unregister_codec(&i2c->dev); return 0; } @@ -1275,7 +1270,7 @@ static struct i2c_driver aic31xx_i2c_driver = { .of_match_table = of_match_ptr(tlv320aic31xx_of_match), }, .probe = aic31xx_i2c_probe, - .remove = (aic31xx_i2c_remove), + .remove = aic31xx_i2c_remove, .id_table = aic31xx_i2c_id, }; |