aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm9712.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm9712.c')
-rw-r--r--sound/soc/codecs/wm9712.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index e04643d2bb24..9517571e820d 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
666 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); 666 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec);
667 int ret = 0; 667 int ret = 0;
668 668
669 wm9712->ac97 = snd_soc_new_ac97_codec(codec); 669 wm9712->ac97 = snd_soc_alloc_ac97_codec(codec);
670 if (IS_ERR(wm9712->ac97)) { 670 if (IS_ERR(wm9712->ac97)) {
671 ret = PTR_ERR(wm9712->ac97); 671 ret = PTR_ERR(wm9712->ac97);
672 dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret); 672 dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret);
@@ -675,15 +675,19 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
675 675
676 ret = wm9712_reset(codec, 0); 676 ret = wm9712_reset(codec, 0);
677 if (ret < 0) 677 if (ret < 0)
678 goto reset_err; 678 goto err_put_device;
679
680 ret = device_add(&wm9712->ac97->dev);
681 if (ret)
682 goto err_put_device;
679 683
680 /* set alc mux to none */ 684 /* set alc mux to none */
681 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); 685 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);
682 686
683 return 0; 687 return 0;
684 688
685reset_err: 689err_put_device:
686 snd_soc_free_ac97_codec(wm9712->ac97); 690 put_device(&wm9712->ac97->dev);
687 return ret; 691 return ret;
688} 692}
689 693