diff options
author | Brian Austin <brian.austin@cirrus.com> | 2012-06-04 14:19:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-05 06:03:35 -0400 |
commit | 134b2f576b9144223dd5b59a496218e3aadaf56b (patch) | |
tree | da9e1220180a369beb91a62de38519c9947f0c64 /sound/soc/codecs/cs42l52.c | |
parent | 571f6a7f07e9dda6c9795398747278e52368c88a (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.c | 18 |
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, | |||
1216 | return -ENOMEM; | 1216 | return -ENOMEM; |
1217 | cs42l52->dev = &i2c_client->dev; | 1217 | cs42l52->dev = &i2c_client->dev; |
1218 | 1218 | ||
1219 | cs42l52->regmap = regmap_init_i2c(i2c_client, &cs42l52_regmap); | 1219 | cs42l52->regmap = devm_regmap_init_i2c(i2c_client, &cs42l52_regmap); |
1220 | if (IS_ERR(cs42l52->regmap)) { | 1220 | if (IS_ERR(cs42l52->regmap)) { |
1221 | ret = PTR_ERR(cs42l52->regmap); | 1221 | ret = PTR_ERR(cs42l52->regmap); |
1222 | dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret); | 1222 | dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret); |
1223 | goto err; | 1223 | return ret; |
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | i2c_set_clientdata(i2c_client, cs42l52); | 1226 | i2c_set_clientdata(i2c_client, cs42l52); |
@@ -1242,7 +1242,7 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client, | |||
1242 | dev_err(&i2c_client->dev, | 1242 | dev_err(&i2c_client->dev, |
1243 | "CS42L52 Device ID (%X). Expected %X\n", | 1243 | "CS42L52 Device ID (%X). Expected %X\n", |
1244 | devid, CS42L52_CHIP_ID); | 1244 | devid, CS42L52_CHIP_ID); |
1245 | goto err_regmap; | 1245 | return ret; |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | regcache_cache_only(cs42l52->regmap, true); | 1248 | regcache_cache_only(cs42l52->regmap, true); |
@@ -1250,23 +1250,13 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client, | |||
1250 | ret = snd_soc_register_codec(&i2c_client->dev, | 1250 | ret = snd_soc_register_codec(&i2c_client->dev, |
1251 | &soc_codec_dev_cs42l52, &cs42l52_dai, 1); | 1251 | &soc_codec_dev_cs42l52, &cs42l52_dai, 1); |
1252 | if (ret < 0) | 1252 | if (ret < 0) |
1253 | goto err_regmap; | 1253 | return ret; |
1254 | return 0; | 1254 | return 0; |
1255 | |||
1256 | err_regmap: | ||
1257 | regmap_exit(cs42l52->regmap); | ||
1258 | |||
1259 | err: | ||
1260 | return ret; | ||
1261 | } | 1255 | } |
1262 | 1256 | ||
1263 | static int cs42l52_i2c_remove(struct i2c_client *client) | 1257 | static int cs42l52_i2c_remove(struct i2c_client *client) |
1264 | { | 1258 | { |
1265 | struct cs42l52_private *cs42l52 = i2c_get_clientdata(client); | ||
1266 | |||
1267 | snd_soc_unregister_codec(&client->dev); | 1259 | snd_soc_unregister_codec(&client->dev); |
1268 | regmap_exit(cs42l52->regmap); | ||
1269 | |||
1270 | return 0; | 1260 | return 0; |
1271 | } | 1261 | } |
1272 | 1262 | ||