aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2014-01-15 10:51:56 -0500
committerMark Brown <broonie@linaro.org>2014-02-03 07:45:33 -0500
commit45fce59496cbabd46761e6980c05c82d94d08eaa (patch)
treee5da21552f494e04ee2b7d6d59782ed51a6a1957
parentca65b492c7a265b220f763fd68bf87391213248f (diff)
ASoC: simple-card: simplify code
The platform data structure contains information which is used only by the driver, and the driver allocates platform information fields which are of no use. Move the driver specific data to a new private structure and cleanup the platform data structure. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--include/sound/simple_card.h4
-rw-r--r--sound/soc/generic/simple-card.c14
2 files changed, 11 insertions, 7 deletions
diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
index 6c74527d4926..e1ac996c8feb 100644
--- a/include/sound/simple_card.h
+++ b/include/sound/simple_card.h
@@ -29,10 +29,6 @@ struct asoc_simple_card_info {
29 unsigned int daifmt; 29 unsigned int daifmt;
30 struct asoc_simple_dai cpu_dai; 30 struct asoc_simple_dai cpu_dai;
31 struct asoc_simple_dai codec_dai; 31 struct asoc_simple_dai codec_dai;
32
33 /* used in simple-card.c */
34 struct snd_soc_dai_link snd_link;
35 struct snd_soc_card snd_card;
36}; 32};
37 33
38#endif /* __SIMPLE_CARD_H */ 34#endif /* __SIMPLE_CARD_H */
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 90c6fd5c2c7e..0f11c2808437 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -15,6 +15,14 @@
15#include <linux/string.h> 15#include <linux/string.h>
16#include <sound/simple_card.h> 16#include <sound/simple_card.h>
17 17
18struct simple_card_data {
19 struct snd_soc_card snd_card;
20 unsigned int daifmt;
21 struct asoc_simple_dai cpu_dai;
22 struct asoc_simple_dai codec_dai;
23 struct snd_soc_dai_link snd_link;
24};
25
18static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai, 26static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
19 struct asoc_simple_dai *set, 27 struct asoc_simple_dai *set,
20 unsigned int daifmt) 28 unsigned int daifmt)
@@ -39,7 +47,7 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
39 47
40static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd) 48static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
41{ 49{
42 struct asoc_simple_card_info *info = 50 struct simple_card_data *info =
43 snd_soc_card_get_drvdata(rtd->card); 51 snd_soc_card_get_drvdata(rtd->card);
44 struct snd_soc_dai *codec = rtd->codec_dai; 52 struct snd_soc_dai *codec = rtd->codec_dai;
45 struct snd_soc_dai *cpu = rtd->cpu_dai; 53 struct snd_soc_dai *cpu = rtd->cpu_dai;
@@ -121,7 +129,7 @@ parse_error:
121} 129}
122 130
123static int asoc_simple_card_parse_of(struct device_node *node, 131static int asoc_simple_card_parse_of(struct device_node *node,
124 struct asoc_simple_card_info *info, 132 struct simple_card_data *info,
125 struct device *dev) 133 struct device *dev)
126{ 134{
127 struct snd_soc_dai_link *dai_link = info->snd_card.dai_link; 135 struct snd_soc_dai_link *dai_link = info->snd_card.dai_link;
@@ -195,7 +203,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
195 203
196static int asoc_simple_card_probe(struct platform_device *pdev) 204static int asoc_simple_card_probe(struct platform_device *pdev)
197{ 205{
198 struct asoc_simple_card_info *priv; 206 struct simple_card_data *priv;
199 struct snd_soc_dai_link *dai_link; 207 struct snd_soc_dai_link *dai_link;
200 struct device_node *np = pdev->dev.of_node; 208 struct device_node *np = pdev->dev.of_node;
201 struct device *dev = &pdev->dev; 209 struct device *dev = &pdev->dev;