diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/generic/simple-card.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 28aa5e2d859d..a8877076bdfd 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -29,6 +29,8 @@ struct simple_card_data { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | #define simple_priv_to_dev(priv) ((priv)->snd_card.dev) | 31 | #define simple_priv_to_dev(priv) ((priv)->snd_card.dev) |
32 | #define simple_priv_to_link(priv, i) ((priv)->snd_card.dai_link + i) | ||
33 | #define simple_priv_to_props(priv, i) ((priv)->dai_props + i) | ||
32 | 34 | ||
33 | static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream, | 35 | static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream, |
34 | struct snd_pcm_hw_params *params) | 36 | struct snd_pcm_hw_params *params) |
@@ -173,11 +175,12 @@ asoc_simple_card_sub_parse_of(struct device_node *np, | |||
173 | 175 | ||
174 | static int asoc_simple_card_dai_link_of(struct device_node *node, | 176 | static int asoc_simple_card_dai_link_of(struct device_node *node, |
175 | struct simple_card_data *priv, | 177 | struct simple_card_data *priv, |
176 | struct snd_soc_dai_link *dai_link, | 178 | int idx, |
177 | struct simple_dai_props *dai_props, | ||
178 | bool is_top_level_node) | 179 | bool is_top_level_node) |
179 | { | 180 | { |
180 | struct device *dev = simple_priv_to_dev(priv); | 181 | struct device *dev = simple_priv_to_dev(priv); |
182 | struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx); | ||
183 | struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx); | ||
181 | struct device_node *np = NULL; | 184 | struct device_node *np = NULL; |
182 | struct device_node *bitclkmaster = NULL; | 185 | struct device_node *bitclkmaster = NULL; |
183 | struct device_node *framemaster = NULL; | 186 | struct device_node *framemaster = NULL; |
@@ -325,8 +328,6 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
325 | struct simple_card_data *priv) | 328 | struct simple_card_data *priv) |
326 | { | 329 | { |
327 | struct device *dev = simple_priv_to_dev(priv); | 330 | struct device *dev = simple_priv_to_dev(priv); |
328 | struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link; | ||
329 | struct simple_dai_props *dai_props = priv->dai_props; | ||
330 | u32 val; | 331 | u32 val; |
331 | int ret; | 332 | int ret; |
332 | 333 | ||
@@ -368,9 +369,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
368 | for_each_child_of_node(node, np) { | 369 | for_each_child_of_node(node, np) { |
369 | dev_dbg(dev, "\tlink %d:\n", i); | 370 | dev_dbg(dev, "\tlink %d:\n", i); |
370 | ret = asoc_simple_card_dai_link_of(np, priv, | 371 | ret = asoc_simple_card_dai_link_of(np, priv, |
371 | dai_link + i, | 372 | i, false); |
372 | dai_props + i, | ||
373 | false); | ||
374 | if (ret < 0) { | 373 | if (ret < 0) { |
375 | of_node_put(np); | 374 | of_node_put(np); |
376 | return ret; | 375 | return ret; |
@@ -379,8 +378,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
379 | } | 378 | } |
380 | } else { | 379 | } else { |
381 | /* For single DAI link & old style of DT node */ | 380 | /* For single DAI link & old style of DT node */ |
382 | ret = asoc_simple_card_dai_link_of(node, priv, | 381 | ret = asoc_simple_card_dai_link_of(node, priv, 0, true); |
383 | dai_link, dai_props, true); | ||
384 | if (ret < 0) | 382 | if (ret < 0) |
385 | return ret; | 383 | return ret; |
386 | } | 384 | } |