diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-05-08 11:44:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-05-08 13:46:31 -0400 |
commit | 41a41eaca48946a69bb0a1f6e053b9e4f1458e15 (patch) | |
tree | 0a29c55c107cd8041f333b0f234ffce20feb6ab9 /sound/soc/codecs | |
parent | 8d8c0b362e970abe719ad9615ea59039730932f6 (diff) |
ASoC: alc5632: Convert to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/alc5632.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index b29a53be75a7..7dd02420b36d 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c | |||
@@ -1130,7 +1130,7 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client, | |||
1130 | 1130 | ||
1131 | i2c_set_clientdata(client, alc5632); | 1131 | i2c_set_clientdata(client, alc5632); |
1132 | 1132 | ||
1133 | alc5632->regmap = regmap_init_i2c(client, &alc5632_regmap); | 1133 | alc5632->regmap = devm_regmap_init_i2c(client, &alc5632_regmap); |
1134 | if (IS_ERR(alc5632->regmap)) { | 1134 | if (IS_ERR(alc5632->regmap)) { |
1135 | ret = PTR_ERR(alc5632->regmap); | 1135 | ret = PTR_ERR(alc5632->regmap); |
1136 | dev_err(&client->dev, "regmap_init() failed: %d\n", ret); | 1136 | dev_err(&client->dev, "regmap_init() failed: %d\n", ret); |
@@ -1142,7 +1142,6 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client, | |||
1142 | if (ret1 != 0 || ret2 != 0) { | 1142 | if (ret1 != 0 || ret2 != 0) { |
1143 | dev_err(&client->dev, | 1143 | dev_err(&client->dev, |
1144 | "Failed to read chip ID: ret1=%d, ret2=%d\n", ret1, ret2); | 1144 | "Failed to read chip ID: ret1=%d, ret2=%d\n", ret1, ret2); |
1145 | regmap_exit(alc5632->regmap); | ||
1146 | return -EIO; | 1145 | return -EIO; |
1147 | } | 1146 | } |
1148 | 1147 | ||
@@ -1151,14 +1150,12 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client, | |||
1151 | if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) { | 1150 | if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) { |
1152 | dev_err(&client->dev, | 1151 | dev_err(&client->dev, |
1153 | "Device is not a ALC5632: VID1=0x%x, VID2=0x%x\n", vid1, vid2); | 1152 | "Device is not a ALC5632: VID1=0x%x, VID2=0x%x\n", vid1, vid2); |
1154 | regmap_exit(alc5632->regmap); | ||
1155 | return -EINVAL; | 1153 | return -EINVAL; |
1156 | } | 1154 | } |
1157 | 1155 | ||
1158 | ret = alc5632_reset(alc5632->regmap); | 1156 | ret = alc5632_reset(alc5632->regmap); |
1159 | if (ret < 0) { | 1157 | if (ret < 0) { |
1160 | dev_err(&client->dev, "Failed to issue reset\n"); | 1158 | dev_err(&client->dev, "Failed to issue reset\n"); |
1161 | regmap_exit(alc5632->regmap); | ||
1162 | return ret; | 1159 | return ret; |
1163 | } | 1160 | } |
1164 | 1161 | ||
@@ -1176,7 +1173,6 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client, | |||
1176 | 1173 | ||
1177 | if (ret < 0) { | 1174 | if (ret < 0) { |
1178 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); | 1175 | dev_err(&client->dev, "Failed to register codec: %d\n", ret); |
1179 | regmap_exit(alc5632->regmap); | ||
1180 | return ret; | 1176 | return ret; |
1181 | } | 1177 | } |
1182 | 1178 | ||
@@ -1185,9 +1181,7 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client, | |||
1185 | 1181 | ||
1186 | static __devexit int alc5632_i2c_remove(struct i2c_client *client) | 1182 | static __devexit int alc5632_i2c_remove(struct i2c_client *client) |
1187 | { | 1183 | { |
1188 | struct alc5632_priv *alc5632 = i2c_get_clientdata(client); | ||
1189 | snd_soc_unregister_codec(&client->dev); | 1184 | snd_soc_unregister_codec(&client->dev); |
1190 | regmap_exit(alc5632->regmap); | ||
1191 | return 0; | 1185 | return 0; |
1192 | } | 1186 | } |
1193 | 1187 | ||