diff options
Diffstat (limited to 'sound/soc/codecs/wm9713.c')
-rw-r--r-- | sound/soc/codecs/wm9713.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 71b9d5b0734d..6ab1122a3872 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c | |||
@@ -1225,7 +1225,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) | |||
1225 | struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); | 1225 | struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); |
1226 | int ret = 0, reg; | 1226 | int ret = 0, reg; |
1227 | 1227 | ||
1228 | wm9713->ac97 = snd_soc_new_ac97_codec(codec); | 1228 | wm9713->ac97 = snd_soc_alloc_ac97_codec(codec); |
1229 | if (IS_ERR(wm9713->ac97)) | 1229 | if (IS_ERR(wm9713->ac97)) |
1230 | return PTR_ERR(wm9713->ac97); | 1230 | return PTR_ERR(wm9713->ac97); |
1231 | 1231 | ||
@@ -1234,7 +1234,11 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) | |||
1234 | wm9713_reset(codec, 0); | 1234 | wm9713_reset(codec, 0); |
1235 | ret = wm9713_reset(codec, 1); | 1235 | ret = wm9713_reset(codec, 1); |
1236 | if (ret < 0) | 1236 | if (ret < 0) |
1237 | goto reset_err; | 1237 | goto err_put_device; |
1238 | |||
1239 | ret = device_add(&wm9713->ac97->dev); | ||
1240 | if (ret) | ||
1241 | goto err_put_device; | ||
1238 | 1242 | ||
1239 | /* unmute the adc - move to kcontrol */ | 1243 | /* unmute the adc - move to kcontrol */ |
1240 | reg = ac97_read(codec, AC97_CD) & 0x7fff; | 1244 | reg = ac97_read(codec, AC97_CD) & 0x7fff; |
@@ -1242,8 +1246,8 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) | |||
1242 | 1246 | ||
1243 | return 0; | 1247 | return 0; |
1244 | 1248 | ||
1245 | reset_err: | 1249 | err_put_device: |
1246 | snd_soc_free_ac97_codec(wm9713->ac97); | 1250 | put_device(&wm9713->ac97->dev); |
1247 | return ret; | 1251 | return ret; |
1248 | } | 1252 | } |
1249 | 1253 | ||