diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-09 10:22:35 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-12-09 10:22:35 -0500 |
commit | fa5236985b108250de81e7384c62e3abc9ff3a71 (patch) | |
tree | ef96549faf6785144e87250ff20d3216120d137b /sound | |
parent | e00457d2e093fef1f0688e32948d7823e9d8e38a (diff) | |
parent | f911fa829df92fcdf97126955c4447e750432260 (diff) |
Merge remote-tracking branch 'asoc/topic/wm8985' into asoc-next
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8985.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index 14f666398d0c..7b3f4097609b 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c | |||
@@ -1122,33 +1122,22 @@ static int __devinit wm8985_spi_probe(struct spi_device *spi) | |||
1122 | 1122 | ||
1123 | spi_set_drvdata(spi, wm8985); | 1123 | spi_set_drvdata(spi, wm8985); |
1124 | 1124 | ||
1125 | wm8985->regmap = regmap_init_spi(spi, &wm8985_regmap); | 1125 | wm8985->regmap = devm_regmap_init_spi(spi, &wm8985_regmap); |
1126 | if (IS_ERR(wm8985->regmap)) { | 1126 | if (IS_ERR(wm8985->regmap)) { |
1127 | ret = PTR_ERR(wm8985->regmap); | 1127 | ret = PTR_ERR(wm8985->regmap); |
1128 | dev_err(&spi->dev, "Failed to allocate register map: %d\n", | 1128 | dev_err(&spi->dev, "Failed to allocate register map: %d\n", |
1129 | ret); | 1129 | ret); |
1130 | goto err; | 1130 | return ret; |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | ret = snd_soc_register_codec(&spi->dev, | 1133 | ret = snd_soc_register_codec(&spi->dev, |
1134 | &soc_codec_dev_wm8985, &wm8985_dai, 1); | 1134 | &soc_codec_dev_wm8985, &wm8985_dai, 1); |
1135 | if (ret != 0) | ||
1136 | goto err; | ||
1137 | |||
1138 | return 0; | ||
1139 | |||
1140 | err: | ||
1141 | regmap_exit(wm8985->regmap); | ||
1142 | return ret; | 1135 | return ret; |
1143 | } | 1136 | } |
1144 | 1137 | ||
1145 | static int __devexit wm8985_spi_remove(struct spi_device *spi) | 1138 | static int __devexit wm8985_spi_remove(struct spi_device *spi) |
1146 | { | 1139 | { |
1147 | struct wm8985_priv *wm8985 = spi_get_drvdata(spi); | ||
1148 | |||
1149 | snd_soc_unregister_codec(&spi->dev); | 1140 | snd_soc_unregister_codec(&spi->dev); |
1150 | regmap_exit(wm8985->regmap); | ||
1151 | |||
1152 | return 0; | 1141 | return 0; |
1153 | } | 1142 | } |
1154 | 1143 | ||
@@ -1175,33 +1164,22 @@ static __devinit int wm8985_i2c_probe(struct i2c_client *i2c, | |||
1175 | 1164 | ||
1176 | i2c_set_clientdata(i2c, wm8985); | 1165 | i2c_set_clientdata(i2c, wm8985); |
1177 | 1166 | ||
1178 | wm8985->regmap = regmap_init_i2c(i2c, &wm8985_regmap); | 1167 | wm8985->regmap = devm_regmap_init_i2c(i2c, &wm8985_regmap); |
1179 | if (IS_ERR(wm8985->regmap)) { | 1168 | if (IS_ERR(wm8985->regmap)) { |
1180 | ret = PTR_ERR(wm8985->regmap); | 1169 | ret = PTR_ERR(wm8985->regmap); |
1181 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | 1170 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
1182 | ret); | 1171 | ret); |
1183 | goto err; | 1172 | return ret; |
1184 | } | 1173 | } |
1185 | 1174 | ||
1186 | ret = snd_soc_register_codec(&i2c->dev, | 1175 | ret = snd_soc_register_codec(&i2c->dev, |
1187 | &soc_codec_dev_wm8985, &wm8985_dai, 1); | 1176 | &soc_codec_dev_wm8985, &wm8985_dai, 1); |
1188 | if (ret != 0) | ||
1189 | goto err; | ||
1190 | |||
1191 | return 0; | ||
1192 | |||
1193 | err: | ||
1194 | regmap_exit(wm8985->regmap); | ||
1195 | return ret; | 1177 | return ret; |
1196 | } | 1178 | } |
1197 | 1179 | ||
1198 | static __devexit int wm8985_i2c_remove(struct i2c_client *i2c) | 1180 | static __devexit int wm8985_i2c_remove(struct i2c_client *i2c) |
1199 | { | 1181 | { |
1200 | struct wm8985_priv *wm8985 = i2c_get_clientdata(i2c); | ||
1201 | |||
1202 | snd_soc_unregister_codec(&i2c->dev); | 1182 | snd_soc_unregister_codec(&i2c->dev); |
1203 | regmap_exit(wm8985->regmap); | ||
1204 | |||
1205 | return 0; | 1183 | return 0; |
1206 | } | 1184 | } |
1207 | 1185 | ||