* [PATCH] ASoC: ml26124: Convert to devm_regmap_init_i2c
@ 2012-06-13 6:36 Axel Lin
2012-06-13 9:27 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-06-13 6:36 UTC (permalink / raw)
To: alsa-devel; +Cc: Tomoya MORINAGA, Liam Girdwood, Mark Brown
This fixes a leak if snd_soc_register_codec fails.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
sound/soc/codecs/ml26124.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c
index 22cb5bf..96aa5fa 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;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: ml26124: Convert to devm_regmap_init_i2c
2012-06-13 6:36 [PATCH] ASoC: ml26124: Convert to devm_regmap_init_i2c Axel Lin
@ 2012-06-13 9:27 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-06-13 9:27 UTC (permalink / raw)
To: Axel Lin; +Cc: alsa-devel, Tomoya MORINAGA, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 129 bytes --]
On Wed, Jun 13, 2012 at 02:36:07PM +0800, Axel Lin wrote:
> This fixes a leak if snd_soc_register_codec fails.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-13 9:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13 6:36 [PATCH] ASoC: ml26124: Convert to devm_regmap_init_i2c Axel Lin
2012-06-13 9:27 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.