From: Axel Lin Date: Wed, 13 Jun 2012 06:36:07 +0000 (+0800) Subject: ASoC: ml26124: Convert to devm_regmap_init_i2c X-Git-Tag: next-20120724~59^2~86 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8994a5e1d2443511e677d62e97d7de3718b71325;p=karo-tx-linux.git ASoC: ml26124: Convert to devm_regmap_init_i2c This fixes a leak if snd_soc_register_codec fails. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- 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, i2c_set_clientdata(i2c, priv); - priv->regmap = regmap_init_i2c(i2c, &ml26124_i2c_regmap); + priv->regmap = devm_regmap_init_i2c(i2c, &ml26124_i2c_regmap); if (IS_ERR(priv->regmap)) { ret = PTR_ERR(priv->regmap); 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, static __devexit int ml26124_i2c_remove(struct i2c_client *client) { - struct ml26124_priv *priv = i2c_get_clientdata(client); - snd_soc_unregister_codec(&client->dev); - regmap_exit(priv->regmap); return 0; }