From f835492fe97e226d14eab2e00c30a9bc5f59fe06 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 8 Apr 2011 14:50:44 +0900 Subject: [PATCH] --- yaml --- r: 248271 b: refs/heads/master c: 0671fd8ef4b32200e75396cd299f0853002fc11e h: refs/heads/master i: 248269: 2f08cfa1d295c4a0297a057b9f86e78a7b0a92f1 248267: 45e2bad1b85130f7a6ffa335833e315a09707af0 248263: f83f98f6b7d86f35a0b5d6c5dd80e16c012858b4 248255: 7705ecfd2761845e41ee0bc010e35d3a33f5f39e v: v3 --- [refs] | 2 +- trunk/sound/soc/soc-core.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index fe41dd73d165..b356e607426c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b8eeee68dc81f08993ed5dc18dc6d574ba146674 +refs/heads/master: 0671fd8ef4b32200e75396cd299f0853002fc11e diff --git a/trunk/sound/soc/soc-core.c b/trunk/sound/soc/soc-core.c index f75f13926049..1f114673e952 100644 --- a/trunk/sound/soc/soc-core.c +++ b/trunk/sound/soc/soc-core.c @@ -1453,6 +1453,16 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num) } } +static void soc_remove_dai_links(struct snd_soc_card *card) +{ + int i; + + for (i = 0; i < card->num_rtd; i++) + soc_remove_dai_link(card, i); + + card->num_rtd = 0; +} + static void soc_set_name_prefix(struct snd_soc_card *card, struct snd_soc_codec *codec) { @@ -1960,8 +1970,7 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) soc_remove_aux_dev(card, i); probe_dai_err: - for (i = 0; i < card->num_links; i++) - soc_remove_dai_link(card, i); + soc_remove_dai_links(card); card_probe_error: if (card->remove) @@ -2023,8 +2032,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) soc_remove_aux_dev(card, i); /* remove and free each DAI */ - for (i = 0; i < card->num_rtd; i++) - soc_remove_dai_link(card, i); + soc_remove_dai_links(card); soc_cleanup_card_debugfs(card);