speedtch speedtch.c,1.47,1.48

Duncan Sands duncan at infradead.org
Fri Apr 15 06:22:38 EDT 2005


Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv8557

Modified Files:
	speedtch.c 
Log Message:
Minor tweaks.  By the way, I haven't tested the last bunch of (trivial)
patches, because I can't afford to have my internet connection go down
right now!  But they seem harmless.


Index: speedtch.c
===================================================================
RCS file: /home/cvs/speedtch/speedtch.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- speedtch.c	15 Apr 2005 08:58:54 -0000	1.47
+++ speedtch.c	15 Apr 2005 10:22:35 -0000	1.48
@@ -98,17 +98,6 @@
 	struct work_struct poll_work;
 	struct timer_list poll_timer;
 };
-/* USB */
-
-static struct usb_device_id speedtch_usb_ids[] = {
-	{USB_DEVICE(0x06b9, 0x4061)},
-	{}
-};
-
-MODULE_DEVICE_TABLE(usb, speedtch_usb_ids);
-
-static int speedtch_usb_probe(struct usb_interface *, const struct usb_device_id *);
-
 
 /***************
 **  firmware  **
@@ -717,6 +706,15 @@
 **  USB  **
 **********/
 
+static struct usb_device_id speedtch_usb_ids[] = {
+	{USB_DEVICE(0x06b9, 0x4061)},
+	{}
+};
+
+MODULE_DEVICE_TABLE(usb, speedtch_usb_ids);
+
+static int speedtch_usb_probe(struct usb_interface *, const struct usb_device_id *);
+
 static struct usb_driver speedtch_usb_driver = {
 	.owner		= THIS_MODULE,
 	.name		= speedtch_driver_name,
@@ -745,16 +743,16 @@
 	struct usb_interface *cur_intf;
 	struct speedtch_instance_data *instance;
 	int ifnum = intf->altsetting->desc.bInterfaceNumber;
-	const int num_interfaces = usb_dev->actconfig->desc.bNumInterfaces;
+	int num_interfaces = usb_dev->actconfig->desc.bNumInterfaces;
 	int i, ret;
 	char buf7[SIZE_7];
 
-	usb_dbg(usbatm, "%s: trying device with vendor=0x%x, product=0x%x, ifnum %d\n",
-	    __func__, le16_to_cpu(usb_dev->descriptor.idVendor),
-	    le16_to_cpu(usb_dev->descriptor.idProduct), ifnum);
+	usb_dbg(usbatm, "%s entered\n", __func__);
 
-	if (usb_dev->descriptor.bDeviceClass != USB_CLASS_VENDOR_SPEC)
+	if (usb_dev->descriptor.bDeviceClass != USB_CLASS_VENDOR_SPEC) {
+		usb_dbg(usbatm, "%s: wrong device class %d\n", __func__, usb_dev->descriptor.bDeviceClass);
 		return -ENODEV;
+	}
 
 	/* claim all interfaces */
 
@@ -790,6 +788,8 @@
 
 	*need_heavy_init = (ret != SIZE_7);
 
+	usb_dbg(usbatm, "%s: firmware %s loaded\n", __func__, need_heavy_init ? "not" : "already");
+
 	if (*need_heavy_init)
 		if ((ret = usb_reset_device(usb_dev)) < 0)
 			goto fail_free;




More information about the Usbatm-commits mailing list