From: Takashi Iwai Subject: Re: [PATCH v4 09/15] ALSA: usb-audio: conditional interface altsetting Date: Mon, 07 Oct 2013 12:34:12 +0200 Message-ID: References: <1381091480-23636-1-git-send-email-eldad@fogrefinery.com> <1381091480-23636-10-git-send-email-eldad@fogrefinery.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 E11BD265087 for ; Mon, 7 Oct 2013 12:31:38 +0200 (CEST) In-Reply-To: <1381091480-23636-10-git-send-email-eldad@fogrefinery.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: Eldad Zack Cc: Nikolay Martynov , Clemens Ladisch , alsa-devel@alsa-project.org, Daniel Mack List-Id: alsa-devel@alsa-project.org At Sun, 6 Oct 2013 22:31:14 +0200, Eldad Zack wrote: > > On some devices, if the endpoint for the other direction is in use, > setting one interface will shutdown the other (in use) endpoint. > This patch moves all of the alternate setting operations for pcm > ops to one function which checks if we can do so. > > If current alternate is 0, it is safe to set. Is this check needed for all devices? The combination of playback and capture streams in snd_usb_substream is casual, just depending on the enumeration. It doesn't always mean that these are coupled. For non-implicit-fb devices, won't this result in a false positive? Also... > +static int subs_set_interface(struct snd_usb_substream *subs, int ifnum, > + int altsetting) > +{ > + struct snd_usb_substream *other_subs; > + int err; > + > + snd_printdd(KERN_DEBUG "%s: Requested set interface %d alts %d\n", > + __func__, ifnum, altsetting); > + > + if (subs == NULL) > + return usb_set_interface(subs->dev, ifnum, altsetting); It must lead to Oops. thanks, Takashi