Commit 240f1d1a authored by Manuel Reinhardt's avatar Manuel Reinhardt Committed by Greg Kroah-Hartman

ALSA: usb-audio: Fix implicit fb endpoint setup by quirk

commit 2bc16b9f upstream.

The commit a60945fd ("ALSA: usb-audio: move implicit fb quirks to
separate function") introduced an error in the handling of quirks for
implicit feedback endpoints. This commit fixes this.

If a quirk successfully sets up an implicit feedback endpoint, usb-audio
no longer tries to find the implicit fb endpoint itself.

Fixes: a60945fd ("ALSA: usb-audio: move implicit fb quirks to separate function")
Signed-off-by: default avatarManuel Reinhardt <manuel.rhdt@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3ca538b7
...@@ -313,6 +313,9 @@ static int search_roland_implicit_fb(struct usb_device *dev, int ifnum, ...@@ -313,6 +313,9 @@ static int search_roland_implicit_fb(struct usb_device *dev, int ifnum,
return 0; return 0;
} }
/* Setup an implicit feedback endpoint from a quirk. Returns 0 if no quirk
* applies. Returns 1 if a quirk was found.
*/
static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
struct usb_device *dev, struct usb_device *dev,
struct usb_interface_descriptor *altsd, struct usb_interface_descriptor *altsd,
...@@ -391,7 +394,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, ...@@ -391,7 +394,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
subs->data_endpoint->sync_master = subs->sync_endpoint; subs->data_endpoint->sync_master = subs->sync_endpoint;
return 0; return 1;
} }
static int set_sync_endpoint(struct snd_usb_substream *subs, static int set_sync_endpoint(struct snd_usb_substream *subs,
...@@ -430,6 +433,10 @@ static int set_sync_endpoint(struct snd_usb_substream *subs, ...@@ -430,6 +433,10 @@ static int set_sync_endpoint(struct snd_usb_substream *subs,
if (err < 0) if (err < 0)
return err; return err;
/* endpoint set by quirk */
if (err > 0)
return 0;
if (altsd->bNumEndpoints < 2) if (altsd->bNumEndpoints < 2)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment