ALSA: remove calls to usb_pipe_type_check for control endpoints
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2020 15:37:56 +0000 (17:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Sep 2020 09:03:02 +0000 (11:03 +0200)
A USB device will always haev a bi-directional endpoint 0, that's just
how the devices work, so no need to check for that in a few quirk tests
as it will always pass.

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Alexander Tsoy <alexander@tsoy.me>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200914153756.3412156-12-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/quirks.c

index 1b482848e73b63ba87350d37d4cdfe4d065b85a1..395d1ea6f03febcf18d4d7684a89a7a5d20d42d4 100644 (file)
@@ -885,8 +885,6 @@ static int snd_usb_nativeinstruments_boot_quirk(struct usb_device *dev)
 {
        int ret;
 
-       if (usb_pipe_type_check(dev, usb_sndctrlpipe(dev, 0)))
-               return -EINVAL;
        ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
                                  0xaf, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                                  1, 0, NULL, 0, 1000);
@@ -994,8 +992,6 @@ static int snd_usb_axefx3_boot_quirk(struct usb_device *dev)
 
        dev_dbg(&dev->dev, "Waiting for Axe-Fx III to boot up...\n");
 
-       if (usb_pipe_type_check(dev, usb_sndctrlpipe(dev, 0)))
-               return -EINVAL;
        /* If the Axe-Fx III has not fully booted, it will timeout when trying
         * to enable the audio streaming interface. A more generous timeout is
         * used here to detect when the Axe-Fx III has finished booting as the
@@ -1127,8 +1123,6 @@ static int snd_usb_motu_m_series_boot_quirk(struct usb_device *dev)
 {
        int ret;
 
-       if (usb_pipe_type_check(dev, usb_sndctrlpipe(dev, 0)))
-               return -EINVAL;
        ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
                              1, USB_TYPE_VENDOR | USB_RECIP_DEVICE,
                              0x0, 0, NULL, 0, 1000);