Skip to content

Commit

Permalink
ALSA: snd-usb: add snd_usb_audio-wide mutex
Browse files Browse the repository at this point in the history
This is needed for new card-wide list operations.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed Apr 13, 2012
1 parent dd775ae commit 596580d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/usb/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif)

static int snd_usb_audio_free(struct snd_usb_audio *chip)
{
mutex_destroy(&chip->mutex);
kfree(chip);
return 0;
}
Expand Down Expand Up @@ -336,6 +337,7 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
return -ENOMEM;
}

mutex_init(&chip->mutex);
mutex_init(&chip->shutdown_mutex);
chip->index = idx;
chip->dev = dev;
Expand Down
1 change: 1 addition & 0 deletions sound/usb/usbaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct snd_usb_audio {
struct snd_card *card;
struct usb_interface *pm_intf;
u32 usb_id;
struct mutex mutex;
struct mutex shutdown_mutex;
unsigned int shutdown:1;
unsigned int probing:1;
Expand Down

0 comments on commit 596580d

Please sign in to comment.