patch-2.3.38 linux/drivers/usb/dc2xx.c

Next file: linux/drivers/usb/ezusb.c
Previous file: linux/drivers/usb/dabusb.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.37/linux/drivers/usb/dc2xx.c linux/drivers/usb/dc2xx.c
@@ -57,11 +57,9 @@
 #include <linux/malloc.h>
 #include <linux/module.h>
 
-#include "usb.h"
-
-
-// #define	CAMERA_DEBUG
+#undef DEBUG
 
+#include "usb.h"
 
 /* XXX need to get registered minor number, cdev 10/MINOR */
 /* XXX or: cdev USB_MAJOR(180)/USB_CAMERA_MINOR */
@@ -163,9 +161,8 @@
 			  usb_rcvbulkpipe (camera->dev, camera->inEP),
 			  camera->buf, len, &count, HZ*10);
 
-#ifdef	CAMERA_DEBUG
-		printk ("camera.r (%d) - 0x%x %ld\n", len, result, count);
-#endif
+		dbg("read (%d) - 0x%x %ld", len, result, count);
+
 		if (!result) {
 			if (copy_to_user (buf, camera->buf, count))
 				return -EFAULT;
@@ -175,9 +172,8 @@
 		if (result != USB_ST_TIMEOUT)
 			break;
 		interruptible_sleep_on_timeout (&camera->wait, RETRY_TIMEOUT);
-#ifdef	CAMERA_DEBUG
-		printk ("camera.r (%d) - retry\n", len);
-#endif
+
+		dbg("read (%d) - retry", len);
 	}
 	camera->isActive = 0;
 	return -EIO;
@@ -230,10 +226,10 @@
 			result = usb_bulk_msg (camera->dev,
 				 usb_sndbulkpipe (camera->dev, camera->outEP),
 				 obuf, thistime, &count, HZ*10);
-#ifdef	CAMERA_DEBUG
+
 			if (result)
-				printk ("camera.w USB err - %x\n", result);
-#endif
+				dbg("write USB err - %x", result);
+
 			if (count) {
 				obuf += count;
 				thistime -= count;
@@ -262,9 +258,9 @@
 	}
 done:
 	camera->isActive = 0;
-#ifdef	CAMERA_DEBUG
-	printk ("camera.w %d\n", bytes_written); 
-#endif
+
+	dbg("write %d", bytes_written); 
+
 	return bytes_written;
 }
 
@@ -280,9 +276,8 @@
 		camera->isOpen = 0;
 		return -ENOMEM;
 	}
-#ifdef	CAMERA_DEBUG
-	printk ("camera.open\n"); 
-#endif
+
+	dbg("open"); 
 	
 	/* Keep driver from being unloaded while it's in use */
 	MOD_INC_USE_COUNT;
@@ -300,9 +295,8 @@
 	kfree (camera->buf);
 	camera->isOpen = 0;
 	MOD_DEC_USE_COUNT;
-#ifdef	CAMERA_DEBUG
-	printk ("camera.close\n"); 
-#endif
+
+	dbg("close"); 
 
 	return 0;
 }
@@ -324,8 +318,6 @@
 	camera_release,
 	NULL,		/* async */
 	NULL,		/* fasync */
-	NULL,		/* check_media_change */
-	NULL,		/* revalidate */
 	NULL,		/* lock */
 };
 
@@ -363,7 +355,7 @@
 	/* these have one config, one interface */
 	if (dev->descriptor.bNumConfigurations != 1
 			|| dev->config[0].bNumInterfaces != 1) {
-		printk (KERN_INFO "Bogus camera config info\n");
+		dbg("Bogus camera config info");
 		return NULL;
 	}
 
@@ -375,16 +367,16 @@
 			|| interface->bInterfaceProtocol != 0
 			|| interface->bNumEndpoints != 2
 			) {
-		printk (KERN_INFO "Bogus camera interface info\n");
+		dbg("Bogus camera interface info");
 		return NULL;
 	}
 
 	/* can only show one camera at a time through /dev ... */
 	if (!camera->dev) {
 		camera->dev = dev;
-		printk(KERN_INFO "USB Camera is connected\n");
+		info("USB Camera is connected");
 	} else {
-		printk(KERN_INFO "Ignoring additional USB Camera\n");
+		info("Ignoring additional USB Camera");
 		return NULL;
 	}
 
@@ -410,14 +402,14 @@
 			|| endpoint [0].bmAttributes != USB_ENDPOINT_XFER_BULK
 			|| endpoint [1].bmAttributes != USB_ENDPOINT_XFER_BULK
 			) {
-		printk (KERN_INFO "Bogus camera endpoints\n");
+		dbg("Bogus camera endpoints");
 		camera->dev = NULL;
 		return NULL;
 	}
 
 
 	if (usb_set_configuration (dev, dev->config[0].bConfigurationValue)) {
-		printk (KERN_INFO "Failed usb_set_configuration: camera\n");
+		err("Failed usb_set_configuration");
 		camera->dev = NULL;
 		return NULL;
 	}
@@ -443,7 +435,7 @@
 	camera->info = NULL;
 	camera->dev = NULL;
 
-	printk (KERN_INFO "USB Camera disconnected\n");
+	info("USB Camera disconnected");
 }
 
 static /* const */ struct usb_driver camera_driver = {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)