diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-05-02 18:14:42 +0200 |
---|---|---|
committer | Li Jun <B47624@freescale.com> | 2014-07-14 15:53:00 +0800 |
commit | 3f09ed591067793233f5aee1debaad24e484dfd3 (patch) | |
tree | 6b0ce5bc156454285fb6b086e69d9e3bbe066d61 | |
parent | f6945cd3b25b7361d8721528f13a8b67f9b6b4b4 (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 07de1e7ba3ec..c95f862089fd 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c @@ -693,8 +693,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; } |