From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
alsa-devel@alsa-project.org,
Ralph Birt <ralph.birt@maximintegrated.com>,
Jerry Wong <jerry.wong@maximintegrated.com>,
Matthew Mowdy <matthew.mowdy@maximintegrated.com>
Subject: [PATCH] ASoC: max98090: Convert to devm_regmap_init_i2c
Date: Sun, 03 Mar 2013 16:49:06 +0800 [thread overview]
Message-ID: <1362300546.9569.6.camel@phoenix> (raw)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
sound/soc/codecs/max98090.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index fc17604..6dd36da 100755
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2324,28 +2324,20 @@ static int max98090_i2c_probe(struct i2c_client *i2c,
max98090->pdata = i2c->dev.platform_data;
max98090->irq = i2c->irq;
- max98090->regmap = regmap_init_i2c(i2c, &max98090_regmap);
+ max98090->regmap = devm_regmap_init_i2c(i2c, &max98090_regmap);
if (IS_ERR(max98090->regmap)) {
ret = PTR_ERR(max98090->regmap);
dev_err(&i2c->dev, "Failed to allocate regmap: %d\n", ret);
- goto err_enable;
+ return ret;
}
- ret = snd_soc_register_codec(&i2c->dev,
- &soc_codec_dev_max98090, max98090_dai,
- ARRAY_SIZE(max98090_dai));
- if (ret < 0)
- regmap_exit(max98090->regmap);
-
-err_enable:
- return ret;
+ return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_max98090,
+ max98090_dai, ARRAY_SIZE(max98090_dai));
}
static int max98090_i2c_remove(struct i2c_client *client)
{
- struct max98090_priv *max98090 = dev_get_drvdata(&client->dev);
snd_soc_unregister_codec(&client->dev);
- regmap_exit(max98090->regmap);
return 0;
}
--
1.7.9.5
next reply other threads:[~2013-03-03 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-03 8:49 Axel Lin [this message]
2013-03-03 14:48 ` [PATCH] ASoC: max98090: Convert to devm_regmap_init_i2c Mark Brown
2013-03-03 14:52 ` Axel Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362300546.9569.6.camel@phoenix \
--to=axel.lin@ingics.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jerry.wong@maximintegrated.com \
--cc=lgirdwood@gmail.com \
--cc=matthew.mowdy@maximintegrated.com \
--cc=ralph.birt@maximintegrated.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.