[alsa-devel] [PATCH RFC 09/10] ALSA: usb-audio: clarify implicit fb quirk for Roland

Eldad Zack eldad at fogrefinery.com
Fri Jul 19 20:23:29 CEST 2013


Move the vendor ID check to the outside and also propogate
the error code.

Signed-off-by: Eldad Zack <eldad at fogrefinery.com>
---
 sound/usb/pcm.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 9f9639d..0704823 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -363,15 +363,20 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
 		alts = &iface->altsetting[1];
 		goto add_sync_ep;
 	}
-	if (attr == USB_ENDPOINT_SYNC_ASYNC &&
-	    altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
-	    altsd->bInterfaceProtocol == 2 &&
-	    altsd->bNumEndpoints == 1 &&
-	    USB_ID_VENDOR(subs->stream->chip->usb_id) == 0x0582 /* Roland */ &&
-	    search_roland_implicit_fb(subs->dev, altsd->bInterfaceNumber + 1,
-				      altsd->bAlternateSetting,
-				      &alts, &ep) >= 0) {
-		goto add_sync_ep;
+
+	if (USB_ID_VENDOR(subs->stream->chip->usb_id) == 0x0582) { /* Roland */
+		if (attr == USB_ENDPOINT_SYNC_ASYNC &&
+		    altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
+		    altsd->bInterfaceProtocol == 2 &&
+		    altsd->bNumEndpoints == 1) {
+			int err = search_roland_implicit_fb(subs->dev, altsd->bInterfaceNumber + 1,
+							altsd->bAlternateSetting,
+						        &alts, &ep);
+			if (err < 0)
+				return err;
+
+			goto add_sync_ep;
+		}
 	}
 
 	/* No quirk */
-- 
1.8.1.5



More information about the Alsa-devel mailing list