Commit 6334e786 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: fix dvb-ttusb-budget driver due to set_configuration locking cleanups

> Oops, you forgot to grep:
>
> CC [M]  drivers/media/dvb/ttusb-dec/ttusb_dec.o
> drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c: In function `ttusb_setup_interfaces':
> drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c:1011: warning: implicit declaration of function `usb_set_configuration'

Well, when I did the grep that bug wasn't there; it
was just integrated on Feb 26!


> Care to send a patch to fix it up before Andrew gets grumpy with me for
> breaking his build?  :)

The first part makes it use usb_reset_configuration() like
it did before ... I'm surprised this driver hasn't been
generating "it deadlocks during probe" reports.

The second part prints a diagnostic if the configuration
wasn't set right; the fix would use hotplug and sysfs.
parent d4f1dca6
...@@ -1008,7 +1008,7 @@ static int ttusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -1008,7 +1008,7 @@ static int ttusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
static int ttusb_setup_interfaces(struct ttusb *ttusb) static int ttusb_setup_interfaces(struct ttusb *ttusb)
{ {
usb_set_configuration(ttusb->dev, 1); usb_reset_configuration(ttusb->dev);
usb_set_interface(ttusb->dev, 1, 1); usb_set_interface(ttusb->dev, 1, 1);
ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1); ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1);
...@@ -1077,6 +1077,17 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i ...@@ -1077,6 +1077,17 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
udev = interface_to_usbdev(intf); udev = interface_to_usbdev(intf);
/* Device has already been reset; its configuration was chosen.
* If this fault happens, use a hotplug script to choose the
* right configuration (write bConfigurationValue in sysfs).
*/
if (udev->actconfig->desc.bConfigurationValue != 1) {
dev_err(&intf->dev, "device config is #%d, need #1\n",
udev->actconfig->desc.bConfigurationValue);
return -ENODEV;
}
if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL))) if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
......
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