aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ml26124.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-06-13 02:36:07 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-13 05:27:27 -0400
commit8994a5e1d2443511e677d62e97d7de3718b71325 (patch)
tree837cea5b2a2229e9e949985e2649e35774cf9b7c /sound/soc/codecs/ml26124.c
parent85f243912b99b053ce0624c30609f5d8fd4445d2 (diff)
ASoC: ml26124: Convert to devm_regmap_init_i2c
This fixes a leak if snd_soc_register_codec fails. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/ml26124.c')
-rw-r--r--sound/soc/codecs/ml26124.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c
index 22cb5bf59273..96aa5fa05160 100644
--- a/sound/soc/codecs/ml26124.c
+++ b/sound/soc/codecs/ml26124.c
@@ -638,7 +638,7 @@ static __devinit int ml26124_i2c_probe(struct i2c_client *i2c,
638 638
639 i2c_set_clientdata(i2c, priv); 639 i2c_set_clientdata(i2c, priv);
640 640
641 priv->regmap = regmap_init_i2c(i2c, &ml26124_i2c_regmap); 641 priv->regmap = devm_regmap_init_i2c(i2c, &ml26124_i2c_regmap);
642 if (IS_ERR(priv->regmap)) { 642 if (IS_ERR(priv->regmap)) {
643 ret = PTR_ERR(priv->regmap); 643 ret = PTR_ERR(priv->regmap);
644 dev_err(&i2c->dev, "regmap_init_i2c() failed: %d\n", ret); 644 dev_err(&i2c->dev, "regmap_init_i2c() failed: %d\n", ret);
@@ -651,10 +651,7 @@ static __devinit int ml26124_i2c_probe(struct i2c_client *i2c,
651 651
652static __devexit int ml26124_i2c_remove(struct i2c_client *client) 652static __devexit int ml26124_i2c_remove(struct i2c_client *client)
653{ 653{
654 struct ml26124_priv *priv = i2c_get_clientdata(client);
655
656 snd_soc_unregister_codec(&client->dev); 654 snd_soc_unregister_codec(&client->dev);
657 regmap_exit(priv->regmap);
658 return 0; 655 return 0;
659} 656}
660 657