aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/generic/simple-card.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2014-01-15 10:52:00 -0500
committerMark Brown <broonie@linaro.org>2014-02-03 07:45:33 -0500
commitb367a3252b365fd545fc589a40cad3976e73d7d7 (patch)
treee25f0c1de3104dc17887d05809d7b89fd211400d /sound/soc/generic/simple-card.c
parent45fce59496cbabd46761e6980c05c82d94d08eaa (diff)
ASoC: simple-card: simplify code
Rename the pointer to the private data structure to 'priv' to avoid confusion with the platform data pointer. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/generic/simple-card.c')
-rw-r--r--sound/soc/generic/simple-card.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 0f11c2808437..6443c87e8625 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -47,18 +47,18 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
47 47
48static 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)
49{ 49{
50 struct simple_card_data *info = 50 struct simple_card_data *priv =
51 snd_soc_card_get_drvdata(rtd->card); 51 snd_soc_card_get_drvdata(rtd->card);
52 struct snd_soc_dai *codec = rtd->codec_dai; 52 struct snd_soc_dai *codec = rtd->codec_dai;
53 struct snd_soc_dai *cpu = rtd->cpu_dai; 53 struct snd_soc_dai *cpu = rtd->cpu_dai;
54 unsigned int daifmt = info->daifmt; 54 unsigned int daifmt = priv->daifmt;
55 int ret; 55 int ret;
56 56
57 ret = __asoc_simple_card_dai_init(codec, &info->codec_dai, daifmt); 57 ret = __asoc_simple_card_dai_init(codec, &priv->codec_dai, daifmt);
58 if (ret < 0) 58 if (ret < 0)
59 return ret; 59 return ret;
60 60
61 ret = __asoc_simple_card_dai_init(cpu, &info->cpu_dai, daifmt); 61 ret = __asoc_simple_card_dai_init(cpu, &priv->cpu_dai, daifmt);
62 if (ret < 0) 62 if (ret < 0)
63 return ret; 63 return ret;
64 64
@@ -129,21 +129,21 @@ parse_error:
129} 129}
130 130
131static int asoc_simple_card_parse_of(struct device_node *node, 131static int asoc_simple_card_parse_of(struct device_node *node,
132 struct simple_card_data *info, 132 struct simple_card_data *priv,
133 struct device *dev) 133 struct device *dev)
134{ 134{
135 struct snd_soc_dai_link *dai_link = info->snd_card.dai_link; 135 struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
136 struct device_node *np; 136 struct device_node *np;
137 char *name; 137 char *name;
138 int ret; 138 int ret;
139 139
140 /* get CPU/CODEC common format via simple-audio-card,format */ 140 /* get CPU/CODEC common format via simple-audio-card,format */
141 info->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") & 141 priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
142 (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK); 142 (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
143 143
144 /* DAPM routes */ 144 /* DAPM routes */
145 if (of_property_read_bool(node, "simple-audio-card,routing")) { 145 if (of_property_read_bool(node, "simple-audio-card,routing")) {
146 ret = snd_soc_of_parse_audio_routing(&info->snd_card, 146 ret = snd_soc_of_parse_audio_routing(&priv->snd_card,
147 "simple-audio-card,routing"); 147 "simple-audio-card,routing");
148 if (ret) 148 if (ret)
149 return ret; 149 return ret;
@@ -154,7 +154,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
154 np = of_get_child_by_name(node, "simple-audio-card,cpu"); 154 np = of_get_child_by_name(node, "simple-audio-card,cpu");
155 if (np) 155 if (np)
156 ret = asoc_simple_card_sub_parse_of(np, 156 ret = asoc_simple_card_sub_parse_of(np,
157 &info->cpu_dai, 157 &priv->cpu_dai,
158 &dai_link->cpu_of_node, 158 &dai_link->cpu_of_node,
159 &dai_link->cpu_dai_name); 159 &dai_link->cpu_dai_name);
160 if (ret < 0) 160 if (ret < 0)
@@ -165,7 +165,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
165 np = of_get_child_by_name(node, "simple-audio-card,codec"); 165 np = of_get_child_by_name(node, "simple-audio-card,codec");
166 if (np) 166 if (np)
167 ret = asoc_simple_card_sub_parse_of(np, 167 ret = asoc_simple_card_sub_parse_of(np,
168 &info->codec_dai, 168 &priv->codec_dai,
169 &dai_link->codec_of_node, 169 &dai_link->codec_of_node,
170 &dai_link->codec_dai_name); 170 &dai_link->codec_dai_name);
171 if (ret < 0) 171 if (ret < 0)
@@ -181,22 +181,22 @@ static int asoc_simple_card_parse_of(struct device_node *node,
181 GFP_KERNEL); 181 GFP_KERNEL);
182 sprintf(name, "%s-%s", dai_link->cpu_dai_name, 182 sprintf(name, "%s-%s", dai_link->cpu_dai_name,
183 dai_link->codec_dai_name); 183 dai_link->codec_dai_name);
184 info->snd_card.name = name; 184 priv->snd_card.name = name;
185 dai_link->name = dai_link->stream_name = name; 185 dai_link->name = dai_link->stream_name = name;
186 186
187 /* simple-card assumes platform == cpu */ 187 /* simple-card assumes platform == cpu */
188 dai_link->platform_of_node = dai_link->cpu_of_node; 188 dai_link->platform_of_node = dai_link->cpu_of_node;
189 189
190 dev_dbg(dev, "card-name : %s\n", name); 190 dev_dbg(dev, "card-name : %s\n", name);
191 dev_dbg(dev, "platform : %04x\n", info->daifmt); 191 dev_dbg(dev, "platform : %04x\n", priv->daifmt);
192 dev_dbg(dev, "cpu : %s / %04x / %d\n", 192 dev_dbg(dev, "cpu : %s / %04x / %d\n",
193 dai_link->cpu_dai_name, 193 dai_link->cpu_dai_name,
194 info->cpu_dai.fmt, 194 priv->cpu_dai.fmt,
195 info->cpu_dai.sysclk); 195 priv->cpu_dai.sysclk);
196 dev_dbg(dev, "codec : %s / %04x / %d\n", 196 dev_dbg(dev, "codec : %s / %04x / %d\n",
197 dai_link->codec_dai_name, 197 dai_link->codec_dai_name,
198 info->codec_dai.fmt, 198 priv->codec_dai.fmt,
199 info->codec_dai.sysclk); 199 priv->codec_dai.sysclk);
200 200
201 return 0; 201 return 0;
202} 202}