[alsa-devel] [PATCH 1/3 v4] ALSA: usb-audio: Move mutex define to more general location
Takashi Iwai
tiwai at suse.de
Mon Nov 10 10:48:23 CET 2014
At Mon, 10 Nov 2014 20:40:35 +1100,
Damien Zammit wrote:
>
> Allow quirks to lock/unlock the usb audio register mutex by moving
> its definition to usbaudio.h
No, no. The quirk shouldn't touch it at all.
(And, even if so, you should never define a static mutex in a header
file!)
Takashi
>
> Signed-off-by: Damien Zammit <damien at zamaudio.com>
> ---
> sound/usb/card.c | 1 -
> sound/usb/usbaudio.h | 2 ++
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 1fab977..d71025b 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -106,7 +106,6 @@ MODULE_PARM_DESC(autoclock, "Enable auto-clock selection for UAC2 devices (defau
> * the all interfaces on the same card as one sound device.
> */
>
> -static DEFINE_MUTEX(register_mutex);
> static struct snd_usb_audio *usb_chip[SNDRV_CARDS];
> static struct usb_driver usb_audio_driver;
>
> diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
> index 91d0380..229978f 100644
> --- a/sound/usb/usbaudio.h
> +++ b/sound/usb/usbaudio.h
> @@ -115,4 +115,6 @@ struct snd_usb_audio_quirk {
> #define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
> #define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
>
> +static DEFINE_MUTEX(register_mutex);
> +
> #endif /* __USBAUDIO_H */
> --
> 1.9.1
>
More information about the Alsa-devel
mailing list