aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8990.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-14 02:35:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-04-16 21:46:22 -0400
commitb2c812e22de88bb79c290c0e718280f10b64a48d (patch)
tree4a5d967714cfb771db351cde525e6946897cca08 /sound/soc/codecs/wm8990.c
parent890c681275ab02623de1187f2d97fc355d76f372 (diff)
ASoC: Add indirection for CODEC private data
One of the features of the multi CODEC work is that it embeds a struct device in the CODEC to provide diagnostics via a sysfs class rather than via the device tree, at which point it's much better to use the struct device private data rather than having two places to store it. Provide an accessor function to allow this change to be made more easily, and update all the CODEC drivers are updated. To ensure use of the accessor the private data structure member is renamed, meaning that if code developed with older an older core that still uses private_data is merged it will fail to build. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/wm8990.c')
-rw-r--r--sound/soc/codecs/wm8990.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 056b787b6ee0..9a9528e9044e 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1011,7 +1011,7 @@ static int wm8990_set_dai_sysclk(struct snd_soc_dai *codec_dai,
1011 int clk_id, unsigned int freq, int dir) 1011 int clk_id, unsigned int freq, int dir)
1012{ 1012{
1013 struct snd_soc_codec *codec = codec_dai->codec; 1013 struct snd_soc_codec *codec = codec_dai->codec;
1014 struct wm8990_priv *wm8990 = codec->private_data; 1014 struct wm8990_priv *wm8990 = snd_soc_codec_get_drvdata(codec);
1015 1015
1016 wm8990->sysclk = freq; 1016 wm8990->sysclk = freq;
1017 return 0; 1017 return 0;
@@ -1523,7 +1523,7 @@ static int wm8990_probe(struct platform_device *pdev)
1523 return -ENOMEM; 1523 return -ENOMEM;
1524 } 1524 }
1525 1525
1526 codec->private_data = wm8990; 1526 snd_soc_codec_set_drvdata(codec, wm8990);
1527 socdev->card->codec = codec; 1527 socdev->card->codec = codec;
1528 mutex_init(&codec->mutex); 1528 mutex_init(&codec->mutex);
1529 INIT_LIST_HEAD(&codec->dapm_widgets); 1529 INIT_LIST_HEAD(&codec->dapm_widgets);
@@ -1540,7 +1540,7 @@ static int wm8990_probe(struct platform_device *pdev)
1540#endif 1540#endif
1541 1541
1542 if (ret != 0) { 1542 if (ret != 0) {
1543 kfree(codec->private_data); 1543 kfree(snd_soc_codec_get_drvdata(codec));
1544 kfree(codec); 1544 kfree(codec);
1545 } 1545 }
1546 return ret; 1546 return ret;
@@ -1560,7 +1560,7 @@ static int wm8990_remove(struct platform_device *pdev)
1560 i2c_unregister_device(codec->control_data); 1560 i2c_unregister_device(codec->control_data);
1561 i2c_del_driver(&wm8990_i2c_driver); 1561 i2c_del_driver(&wm8990_i2c_driver);
1562#endif 1562#endif
1563 kfree(codec->private_data); 1563 kfree(snd_soc_codec_get_drvdata(codec));
1564 kfree(codec); 1564 kfree(codec);
1565 1565
1566 return 0; 1566 return 0;