From 6afd205508a28c2a40c1e7747235d2bc2065ed02 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 26 Jan 2004 22:37:40 -0800 Subject: [PATCH] [PATCH] USB: Update sound/usb/usbaudio.c 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 4802923219235..f6926ed69d379 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -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); -- 2.53.0