[alsa-devel] [PATCH 8/8] ASoC: Pass card instead of dapm context to snd_soc_dapm_new_widgets()
Lars-Peter Clausen
lars at metafoo.de
Tue Aug 27 15:51:01 CEST 2013
snd_soc_dapm_new_widgets() works on the ASoC card as a whole not on a specific
DAPM context. The DAPM context that is passed as the parameter is only used to
look up the pointer to the card. This patch updates the signature of
snd_soc_dapm_new_widgets() to take the card directly.
Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>
---
include/sound/soc-dapm.h | 2 +-
sound/soc/soc-core.c | 2 +-
sound/soc/soc-dapm.c | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c728d28..27a72d5 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -413,7 +413,7 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
struct snd_soc_dapm_widget *sink);
/* dapm path setup */
-int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
+int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c3c4906..7d13c4f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1820,7 +1820,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
list_for_each_entry(codec, &card->codec_dev_list, card_list)
snd_soc_dapm_auto_nc_codec_pins(codec);
- snd_soc_dapm_new_widgets(&card->dapm);
+ snd_soc_dapm_new_widgets(card);
ret = snd_card_register(card->snd_card);
if (ret < 0) {
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7e9afbc4..548b1c9 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2712,9 +2712,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_weak_routes);
*
* Returns 0 for success.
*/
-int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
+int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
{
- struct snd_soc_card *card = dapm->card;
struct snd_soc_dapm_widget *w;
unsigned int val;
--
1.8.0
More information about the Alsa-devel
mailing list