From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/3 v4] ALSA: usb-audio: Move mutex define to more general location Date: Mon, 10 Nov 2014 10:48:23 +0100 Message-ID: References: <1415612437-5557-1-git-send-email-damien@zamaudio.com> <1415612437-5557-2-git-send-email-damien@zamaudio.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 218092606BE for ; Mon, 10 Nov 2014 10:48:24 +0100 (CET) In-Reply-To: <1415612437-5557-2-git-send-email-damien@zamaudio.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Damien Zammit Cc: alsa-devel@alsa-project.org, clemens@ladisch.de, Damien Zammit List-Id: alsa-devel@alsa-project.org 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 > --- > 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 >