diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-05-02 12:14:42 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-05-02 12:14:42 -0400 |
commit | 1c53e7253ed8769a00afa0f06777d731dbe1ba6f (patch) | |
tree | 63d9f275184d0ccd6d2be62d92b6e8d7c2e670f8 | |
parent | b7a7723513dc89f83d6df13206df55d4dc26e825 (diff) |
ALSA: usb-audio: Save mixer status only once at suspend
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>
-rw-r--r-- | sound/usb/card.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c index 893d5a1afc3c..e769d3977716 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -695,8 +695,9 @@ static int usb_audio_suspend(struct usb_interface *intf, pm_message_t message) | |||
695 | chip->autosuspended = 1; | 695 | chip->autosuspended = 1; |
696 | } | 696 | } |
697 | 697 | ||
698 | list_for_each_entry(mixer, &chip->mixer_list, list) | 698 | if (chip->num_suspended_intf == 1) |
699 | snd_usb_mixer_suspend(mixer); | 699 | list_for_each_entry(mixer, &chip->mixer_list, list) |
700 | snd_usb_mixer_suspend(mixer); | ||
700 | 701 | ||
701 | return 0; | 702 | return 0; |
702 | } | 703 | } |