Commit 6afd2055 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[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.
parent 962fd332
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment