summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-05-02 18:14:42 +0200
committerJiri Slaby <jslaby@suse.cz>2015-08-04 16:51:53 +0200
commit708183150dad5f6a2bdde67e8292954012782171 (patch)
treeef7ee06096d976937c846c30c91897bca848618c /sound
parentc26da265bd7f71ab7a9c3f5839dff58122787b06 (diff)
ALSA: usb-audio: Save mixer status only once at suspend
commit 1c53e7253ed8769a00afa0f06777d731dbe1ba6f upstream. The suspend callback of usb-audio driver may be called multiple times per suspend when multiple USB interfaces are bound to a single sound card instance. In such a case, it's superfluous to save the mixer values multiple times. This patch fixes it by checking the counter. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/card.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 3ab9fc47da09..ca55e033cf9d 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -705,8 +705,9 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message)
chip->autosuspended = 1;
}
- list_for_each_entry(mixer, &chip->mixer_list, list)
- snd_usb_mixer_suspend(mixer);
+ if (chip->num_suspended_intf == 1)
+ list_for_each_entry(mixer, &chip->mixer_list, list)
+ snd_usb_mixer_suspend(mixer);
return 0;
}