[1/2] ASoC: dapm: Power off all widgets in the snd_soc_dapm_shutdown
diff mbox

Message ID 1393689843-22916-1-git-send-email-xiaoxiang@xiaomi.com
State Accepted
Commit 57996358f4d679b2bc39d4cd15166bb89fc8d981
Headers show

Commit Message

Xiang Xiao March 1, 2014, 4:04 p.m. UTC
The widgets generated by the machine driver need to power off too.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
---
 sound/soc/soc-dapm.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Mark Brown March 3, 2014, 4:41 a.m. UTC | #1
On Sun, Mar 02, 2014 at 12:04:02AM +0800, Xiang Xiao wrote:
> The widgets generated by the machine driver need to power off too.

Applied, thanks.

Patch
diff mbox

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3651a37..00ed0e9 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3899,7 +3899,7 @@  void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm)
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_free);
 
-static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
+static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm)
 {
 	struct snd_soc_card *card = dapm->card;
 	struct snd_soc_dapm_widget *w;
@@ -3939,12 +3939,12 @@  static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm)
  */
 void snd_soc_dapm_shutdown(struct snd_soc_card *card)
 {
-	struct snd_soc_codec *codec;
+	struct snd_soc_dapm_context *dapm;
 
-	list_for_each_entry(codec, &card->codec_dev_list, card_list) {
-		soc_dapm_shutdown_codec(&codec->dapm);
-		if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY)
-			snd_soc_dapm_set_bias_level(&codec->dapm,
+	list_for_each_entry(dapm, &card->dapm_list, list) {
+		soc_dapm_shutdown_dapm(dapm);
+		if (dapm->bias_level == SND_SOC_BIAS_STANDBY)
+			snd_soc_dapm_set_bias_level(dapm,
 						    SND_SOC_BIAS_OFF);
 	}
 }