Skip to content

Commit ea83ec5

Browse files
committed
ALSA: usb-audio: Remove redundant workaround for Roland quirk
The recent fix for the delayed card registration made the current workaround for QUIRK_AUTODETECT superfluous, since the card registration itself is delayed until the last interface probe. This patch drops the redundant workaround in create_autodetect_quirks() for simplification. Fixes: 39efc9c ("ALSA: usb-audio: Fix last interface check for registration") Link: https://bugzilla.suse.com/show_bug.cgi?id=1205111 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 971cb60 commit ea83ec5

File tree

1 file changed

+3
-41
lines changed

1 file changed

+3
-41
lines changed

sound/usb/quirks.c

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ static int create_auto_midi_quirk(struct snd_usb_audio *chip,
376376

377377
static int create_autodetect_quirk(struct snd_usb_audio *chip,
378378
struct usb_interface *iface,
379-
struct usb_driver *driver)
379+
struct usb_driver *driver,
380+
const struct snd_usb_audio_quirk *quirk)
380381
{
381382
int err;
382383

@@ -386,45 +387,6 @@ static int create_autodetect_quirk(struct snd_usb_audio *chip,
386387
return err;
387388
}
388389

389-
static int create_autodetect_quirks(struct snd_usb_audio *chip,
390-
struct usb_interface *iface,
391-
struct usb_driver *driver,
392-
const struct snd_usb_audio_quirk *quirk)
393-
{
394-
int probed_ifnum = get_iface_desc(iface->altsetting)->bInterfaceNumber;
395-
int ifcount, ifnum, err;
396-
397-
err = create_autodetect_quirk(chip, iface, driver);
398-
if (err < 0)
399-
return err;
400-
401-
/*
402-
* ALSA PCM playback/capture devices cannot be registered in two steps,
403-
* so we have to claim the other corresponding interface here.
404-
*/
405-
ifcount = chip->dev->actconfig->desc.bNumInterfaces;
406-
for (ifnum = 0; ifnum < ifcount; ifnum++) {
407-
if (ifnum == probed_ifnum || quirk->ifnum >= 0)
408-
continue;
409-
iface = usb_ifnum_to_if(chip->dev, ifnum);
410-
if (!iface ||
411-
usb_interface_claimed(iface) ||
412-
get_iface_desc(iface->altsetting)->bInterfaceClass !=
413-
USB_CLASS_VENDOR_SPEC)
414-
continue;
415-
416-
err = create_autodetect_quirk(chip, iface, driver);
417-
if (err >= 0) {
418-
err = usb_driver_claim_interface(driver, iface,
419-
USB_AUDIO_IFACE_UNUSED);
420-
if (err < 0)
421-
return err;
422-
}
423-
}
424-
425-
return 0;
426-
}
427-
428390
/*
429391
* Create a stream for an Edirol UA-700/UA-25/UA-4FX interface.
430392
* The only way to detect the sample rate is by looking at wMaxPacketSize.
@@ -554,7 +516,7 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
554516
static const quirk_func_t quirk_funcs[] = {
555517
[QUIRK_IGNORE_INTERFACE] = ignore_interface_quirk,
556518
[QUIRK_COMPOSITE] = create_composite_quirk,
557-
[QUIRK_AUTODETECT] = create_autodetect_quirks,
519+
[QUIRK_AUTODETECT] = create_autodetect_quirk,
558520
[QUIRK_MIDI_STANDARD_INTERFACE] = create_any_midi_quirk,
559521
[QUIRK_MIDI_FIXED_ENDPOINT] = create_any_midi_quirk,
560522
[QUIRK_MIDI_YAMAHA] = create_any_midi_quirk,

0 commit comments

Comments
 (0)