Skip to content

Commit aa773bf

Browse files
cladischtiwai
authored andcommitted
ALSA: usb-audio: fix automatic Roland/Yamaha MIDI detection
Commit aafe77c (ALSA: usb-audio: add support for many Roland/Yamaha devices) had several logic errors that prevented create_auto_midi_quirk from enumerating any MIDI ports. Reported-by: Keith A. Milner <[email protected]> Signed-off-by: Clemens Ladisch <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 4c2aee0 commit aa773bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sound/usb/quirks.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,19 +319,19 @@ static int create_auto_midi_quirk(struct snd_usb_audio *chip,
319319
if (altsd->bNumEndpoints < 1)
320320
return -ENODEV;
321321
epd = get_endpoint(alts, 0);
322-
if (!usb_endpoint_xfer_bulk(epd) ||
322+
if (!usb_endpoint_xfer_bulk(epd) &&
323323
!usb_endpoint_xfer_int(epd))
324324
return -ENODEV;
325325

326326
switch (USB_ID_VENDOR(chip->usb_id)) {
327327
case 0x0499: /* Yamaha */
328328
err = create_yamaha_midi_quirk(chip, iface, driver, alts);
329-
if (err < 0 && err != -ENODEV)
329+
if (err != -ENODEV)
330330
return err;
331331
break;
332332
case 0x0582: /* Roland */
333333
err = create_roland_midi_quirk(chip, iface, driver, alts);
334-
if (err < 0 && err != -ENODEV)
334+
if (err != -ENODEV)
335335
return err;
336336
break;
337337
}

0 commit comments

Comments
 (0)