]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB: Update sound/usb/usbaudio.c
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 27 Jan 2004 06:37:40 +0000 (22:37 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 27 Jan 2004 06:37:40 +0000 (22:37 -0800)
On Tue, 27 Jan 2004, Greg KH wrote:

> Hm, can you send me a patch to fix up snd_usb_extigy_boot_quirk() in
> sound/usb/usbaudio.c now that this patch broke that code?  :)

Here it is.  The problem with changing things in the core is always that
you may miss some of the repercussions.  In this case the patch will
restore the code's original functionality.

However the whole thing looks a bit creaky to me.  Changing device
descriptors and who knows what else without informing usbcore isn't a good
idea.  What this code _really_ appears to need is some form of
usb_device_reenumerate().  Such a function would fit very nicely into the
framework I've worked out for the revised usb_device_reset(); maybe I'll
add it in there.  It would do essentially the same thing as device_reset
except for skipping the actual port reset.

sound/usb/usbaudio.c

index 480292321923509311a044051fb5108495df7cdb..f6926ed69d37954f9296c0df70f609ad5488d53d 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/usb.h>
+#include <linux/usb_ch9.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/pcm.h>
@@ -2560,9 +2561,10 @@ static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interfac
                err = usb_control_msg(dev, usb_sndctrlpipe(dev,0),
                                      0x10, 0x43, 0x0001, 0x000a, NULL, 0, HZ);
                if (err < 0) snd_printdd("error sending boot message: %d\n", err);
-               err = usb_get_device_descriptor(dev);
+               err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
+                               &dev->descriptor, sizeof(dev->descriptor));
                config = dev->actconfig;
-               if (err < 0) snd_printdd("error usb_get_device_descriptor: %d\n", err);
+               if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
                err = usb_reset_configuration(dev);
                if (err < 0) snd_printdd("error usb_reset_configuration: %d\n", err);
                snd_printdd("extigy_boot: new boot length = %d\n", get_cfg_desc(config)->wTotalLength);