aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8971.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8971.c')
-rw-r--r--sound/soc/codecs/wm8971.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8971.c b/sound/soc/codecs/wm8971.c
index a65b781af512..a99620f335d2 100644
--- a/sound/soc/codecs/wm8971.c
+++ b/sound/soc/codecs/wm8971.c
@@ -415,7 +415,7 @@ static int wm8971_set_dai_sysclk(struct snd_soc_dai *codec_dai,
415 int clk_id, unsigned int freq, int dir) 415 int clk_id, unsigned int freq, int dir)
416{ 416{
417 struct snd_soc_codec *codec = codec_dai->codec; 417 struct snd_soc_codec *codec = codec_dai->codec;
418 struct wm8971_priv *wm8971 = codec->private_data; 418 struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec);
419 419
420 switch (freq) { 420 switch (freq) {
421 case 11289600: 421 case 11289600:
@@ -494,7 +494,7 @@ static int wm8971_pcm_hw_params(struct snd_pcm_substream *substream,
494 struct snd_soc_pcm_runtime *rtd = substream->private_data; 494 struct snd_soc_pcm_runtime *rtd = substream->private_data;
495 struct snd_soc_device *socdev = rtd->socdev; 495 struct snd_soc_device *socdev = rtd->socdev;
496 struct snd_soc_codec *codec = socdev->card->codec; 496 struct snd_soc_codec *codec = socdev->card->codec;
497 struct wm8971_priv *wm8971 = codec->private_data; 497 struct wm8971_priv *wm8971 = snd_soc_codec_get_drvdata(codec);
498 u16 iface = snd_soc_read(codec, WM8971_IFACE) & 0x1f3; 498 u16 iface = snd_soc_read(codec, WM8971_IFACE) & 0x1f3;
499 u16 srate = snd_soc_read(codec, WM8971_SRATE) & 0x1c0; 499 u16 srate = snd_soc_read(codec, WM8971_SRATE) & 0x1c0;
500 int coeff = get_coeff(wm8971->sysclk, params_rate(params)); 500 int coeff = get_coeff(wm8971->sysclk, params_rate(params));
@@ -820,7 +820,7 @@ static int wm8971_probe(struct platform_device *pdev)
820 return -ENOMEM; 820 return -ENOMEM;
821 } 821 }
822 822
823 codec->private_data = wm8971; 823 snd_soc_codec_set_drvdata(codec, wm8971);
824 socdev->card->codec = codec; 824 socdev->card->codec = codec;
825 mutex_init(&codec->mutex); 825 mutex_init(&codec->mutex);
826 INIT_LIST_HEAD(&codec->dapm_widgets); 826 INIT_LIST_HEAD(&codec->dapm_widgets);
@@ -830,7 +830,7 @@ static int wm8971_probe(struct platform_device *pdev)
830 INIT_DELAYED_WORK(&codec->delayed_work, wm8971_work); 830 INIT_DELAYED_WORK(&codec->delayed_work, wm8971_work);
831 wm8971_workq = create_workqueue("wm8971"); 831 wm8971_workq = create_workqueue("wm8971");
832 if (wm8971_workq == NULL) { 832 if (wm8971_workq == NULL) {
833 kfree(codec->private_data); 833 kfree(snd_soc_codec_get_drvdata(codec));
834 kfree(codec); 834 kfree(codec);
835 return -ENOMEM; 835 return -ENOMEM;
836 } 836 }
@@ -844,7 +844,7 @@ static int wm8971_probe(struct platform_device *pdev)
844 844
845 if (ret != 0) { 845 if (ret != 0) {
846 destroy_workqueue(wm8971_workq); 846 destroy_workqueue(wm8971_workq);
847 kfree(codec->private_data); 847 kfree(snd_soc_codec_get_drvdata(codec));
848 kfree(codec); 848 kfree(codec);
849 } 849 }
850 850
@@ -867,7 +867,7 @@ static int wm8971_remove(struct platform_device *pdev)
867 i2c_unregister_device(codec->control_data); 867 i2c_unregister_device(codec->control_data);
868 i2c_del_driver(&wm8971_i2c_driver); 868 i2c_del_driver(&wm8971_i2c_driver);
869#endif 869#endif
870 kfree(codec->private_data); 870 kfree(snd_soc_codec_get_drvdata(codec));
871 kfree(codec); 871 kfree(codec);
872 872
873 return 0; 873 return 0;