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.

- Dave

--- 1.9/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c       Thu Feb 26 03:22:05 
2004
+++ edited/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c    Tue Mar 30 15:50:57 
2004
@@ -1008,7 +1008,7 @@
 
 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);
 
        ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1);
@@ -1076,6 +1076,17 @@
        dprintk("%s: TTUSB DVB connected\n", __FUNCTION__);
 
        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)))
                return -ENOMEM;

Reply via email to