diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2014-03-15 06:32:42 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-17 12:24:56 -0400 |
commit | c56c4d74c6f96d0ff605d8948e127099cf5e6681 (patch) | |
tree | f97eb7b5ab6679ffd9ca0a665d7d42c2c8b4ea78 /sound/soc/generic | |
parent | e512e001dafa54e5ac7244416e340750a4356b41 (diff) |
ASoC: simple-card: Simplify code
The global DAI format is used only in the function
asoc_simple_card_parse_of(). So, move it from the private data
to the stack.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-card.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index dcf37fb69b35..ca7e63ef858a 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -20,7 +20,6 @@ | |||
20 | 20 | ||
21 | struct simple_card_data { | 21 | struct simple_card_data { |
22 | struct snd_soc_card snd_card; | 22 | struct snd_soc_card snd_card; |
23 | unsigned int daifmt; | ||
24 | struct asoc_simple_dai cpu_dai; | 23 | struct asoc_simple_dai cpu_dai; |
25 | struct asoc_simple_dai codec_dai; | 24 | struct asoc_simple_dai codec_dai; |
26 | struct snd_soc_dai_link snd_link; | 25 | struct snd_soc_dai_link snd_link; |
@@ -154,13 +153,14 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
154 | struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link; | 153 | struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link; |
155 | struct device_node *np; | 154 | struct device_node *np; |
156 | char *name; | 155 | char *name; |
156 | unsigned int daifmt; | ||
157 | int ret; | 157 | int ret; |
158 | 158 | ||
159 | /* parsing the card name from DT */ | 159 | /* parsing the card name from DT */ |
160 | snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); | 160 | snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); |
161 | 161 | ||
162 | /* get CPU/CODEC common format via simple-audio-card,format */ | 162 | /* get CPU/CODEC common format via simple-audio-card,format */ |
163 | priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") & | 163 | daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") & |
164 | (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK); | 164 | (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK); |
165 | 165 | ||
166 | /* off-codec widgets */ | 166 | /* off-codec widgets */ |
@@ -183,7 +183,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
183 | ret = -EINVAL; | 183 | ret = -EINVAL; |
184 | np = of_get_child_by_name(node, "simple-audio-card,cpu"); | 184 | np = of_get_child_by_name(node, "simple-audio-card,cpu"); |
185 | if (np) { | 185 | if (np) { |
186 | ret = asoc_simple_card_sub_parse_of(np, priv->daifmt, | 186 | ret = asoc_simple_card_sub_parse_of(np, daifmt, |
187 | &priv->cpu_dai, | 187 | &priv->cpu_dai, |
188 | &dai_link->cpu_of_node, | 188 | &dai_link->cpu_of_node, |
189 | &dai_link->cpu_dai_name); | 189 | &dai_link->cpu_dai_name); |
@@ -196,7 +196,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
196 | ret = -EINVAL; | 196 | ret = -EINVAL; |
197 | np = of_get_child_by_name(node, "simple-audio-card,codec"); | 197 | np = of_get_child_by_name(node, "simple-audio-card,codec"); |
198 | if (np) { | 198 | if (np) { |
199 | ret = asoc_simple_card_sub_parse_of(np, priv->daifmt, | 199 | ret = asoc_simple_card_sub_parse_of(np, daifmt, |
200 | &priv->codec_dai, | 200 | &priv->codec_dai, |
201 | &dai_link->codec_of_node, | 201 | &dai_link->codec_of_node, |
202 | &dai_link->codec_dai_name); | 202 | &dai_link->codec_dai_name); |
@@ -223,7 +223,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
223 | dai_link->platform_of_node = dai_link->cpu_of_node; | 223 | dai_link->platform_of_node = dai_link->cpu_of_node; |
224 | 224 | ||
225 | dev_dbg(dev, "card-name : %s\n", name); | 225 | dev_dbg(dev, "card-name : %s\n", name); |
226 | dev_dbg(dev, "platform : %04x\n", priv->daifmt); | 226 | dev_dbg(dev, "platform : %04x\n", daifmt); |
227 | dev_dbg(dev, "cpu : %s / %04x / %d\n", | 227 | dev_dbg(dev, "cpu : %s / %04x / %d\n", |
228 | dai_link->cpu_dai_name, | 228 | dai_link->cpu_dai_name, |
229 | priv->cpu_dai.fmt, | 229 | priv->cpu_dai.fmt, |