From: Takashi Iwai Subject: Re: [PATCH] ALSA: usb-audio: Assume first control interface is for audio Date: Thu, 02 Sep 2010 11:59:18 +0200 Message-ID: References: <1283418795-3319-1-git-send-email-daniel@caiaq.de> 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 mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 6FB242462C for ; Thu, 2 Sep 2010 11:59:18 +0200 (CEST) In-Reply-To: <1283418795-3319-1-git-send-email-daniel@caiaq.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Daniel Mack Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 2 Sep 2010 17:13:15 +0800, Daniel Mack wrote: > > For devices with more than one control interface, let's assume the first > one contains the audio controls. Unfortunately, there is no field in any > of the descriptors to tell us whether a control interface is for audio > or MIDI controls, so a better check is not easy to implement. > > On a composite device with audio and MIDI functions, for example, the > code currently overwrites chip->ctrl_intf, causing operations on the > control interface to fail if they are issued after the device probe. > > Signed-off-by: Daniel Mack Applied now. Thanks. Takashi > --- > sound/usb/card.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/sound/usb/card.c b/sound/usb/card.c > index 9feb00c..b443a33 100644 > --- a/sound/usb/card.c > +++ b/sound/usb/card.c > @@ -465,7 +465,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev, > goto __error; > } > > - chip->ctrl_intf = alts; > + /* > + * For devices with more than one control interface, we assume the > + * first contains the audio controls. We might need a more specific > + * check here in the future. > + */ > + if (!chip->ctrl_intf) > + chip->ctrl_intf = alts; > > if (err > 0) { > /* create normal USB audio interfaces */ > -- > 1.7.0.4 >