summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs42l52.c
diff options
context:
space:
mode:
authorBrian Austin <brian.austin@cirrus.com>2012-06-04 13:19:42 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-05 11:03:35 +0100
commit134b2f576b9144223dd5b59a496218e3aadaf56b (patch)
treeda9e1220180a369beb91a62de38519c9947f0c64 /sound/soc/codecs/cs42l52.c
parent571f6a7f07e9dda6c9795398747278e52368c88a (diff)
ASoC: cs42l52: Convert to devm_regmap_init_i2c()
Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs42l52.c')
-rw-r--r--sound/soc/codecs/cs42l52.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index ec03abc79a9a..628daf6a1d97 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -1216,11 +1216,11 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
return -ENOMEM;
cs42l52->dev = &i2c_client->dev;
- cs42l52->regmap = regmap_init_i2c(i2c_client, &cs42l52_regmap);
+ cs42l52->regmap = devm_regmap_init_i2c(i2c_client, &cs42l52_regmap);
if (IS_ERR(cs42l52->regmap)) {
ret = PTR_ERR(cs42l52->regmap);
dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret);
- goto err;
+ return ret;
}
i2c_set_clientdata(i2c_client, cs42l52);
@@ -1242,7 +1242,7 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
dev_err(&i2c_client->dev,
"CS42L52 Device ID (%X). Expected %X\n",
devid, CS42L52_CHIP_ID);
- goto err_regmap;
+ return ret;
}
regcache_cache_only(cs42l52->regmap, true);
@@ -1250,23 +1250,13 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
ret = snd_soc_register_codec(&i2c_client->dev,
&soc_codec_dev_cs42l52, &cs42l52_dai, 1);
if (ret < 0)
- goto err_regmap;
+ return ret;
return 0;
-
-err_regmap:
- regmap_exit(cs42l52->regmap);
-
-err:
- return ret;
}
static int cs42l52_i2c_remove(struct i2c_client *client)
{
- struct cs42l52_private *cs42l52 = i2c_get_clientdata(client);
-
snd_soc_unregister_codec(&client->dev);
- regmap_exit(cs42l52->regmap);
-
return 0;
}