Skip to content

Commit

Permalink
ALSA: usb-audio: Save mixer status only once at suspend
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed May 2, 2014
1 parent b7a7723 commit 1c53e72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,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;
}
Expand Down

0 comments on commit 1c53e72

Please sign in to comment.