(patch 5 of 8)

Hi,

Here's a patch for the usb dc2xx driver against 2.2.20-pre2 that brings
it up to the same logic level that is in 2.4.5.

thanks,

greg k-h
diff -Nru a/drivers/usb/dc2xx.c b/drivers/usb/dc2xx.c
--- a/drivers/usb/dc2xx.c       Tue Jun 12 22:34:40 2001
+++ b/drivers/usb/dc2xx.c       Tue Jun 12 22:34:40 2001
@@ -44,11 +44,13 @@
  * 03 Nov, 1999 -- update for 2.3.25 kernel API changes.
  * 08 Jan, 2000 .. multiple camera support
  * 12 Aug, 2000 .. add some real locking, remove an Oops
+ * 08 Apr, 2001 .. Identify version on module load. gb
  *
  * Thanks to:  the folk who've provided USB product IDs, sent in
- * patches, and shared their sucesses!
+ * patches, and shared their successes!
  */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
@@ -59,6 +61,7 @@
 #include <linux/init.h>
 #include <linux/malloc.h>
 #include <linux/module.h>
+
 #ifdef CONFIG_USB_DEBUG
        #define DEBUG
 #else
@@ -67,6 +70,13 @@
 #include <linux/usb.h>
 
 
+/*
+ * Version Information
+ */
+#define DRIVER_VERSION "v1.0.0"
+#define DRIVER_AUTHOR "David Brownell, <[EMAIL PROTECTED]>"
+#define DRIVER_DESC "USB Camera Driver for Kodak DC-2xx series cameras"
+
 
 /* current USB framework handles max of 16 USB devices per driver */
 #define        MAX_CAMERAS             16
@@ -170,7 +180,7 @@
                          usb_rcvbulkpipe (camera->dev, camera->inEP),
                          camera->buf, len, &count, HZ*10);
 
-               dbg ("read (%d) - 0x%x %d", len, retval, count);
+               dbg ("read (%Zd) - 0x%x %d", len, retval, count);
 
                if (!retval) {
                        if (copy_to_user (buf, camera->buf, count))
@@ -183,7 +193,7 @@
                        break;
                interruptible_sleep_on_timeout (&camera->wait, RETRY_TIMEOUT);
 
-               dbg ("read (%d) - retry", len);
+               dbg ("read (%Zd) - retry", len);
        }
        up (&camera->sem);
        return retval;
@@ -267,7 +277,7 @@
        }
 done:
        up (&camera->sem);
-       dbg ("wrote %d", bytes_written); 
+       dbg ("wrote %Zd", bytes_written); 
        return bytes_written;
 }
 
@@ -324,8 +334,9 @@
        if (!camera->dev) {
                minor_data [subminor] = NULL;
                kfree (camera);
-       }
-       up (&camera->sem);
+       } else
+               up (&camera->sem);
+       
        up (&state_table_mutex);
 
        dbg ("close #%d", subminor); 
@@ -396,7 +407,6 @@
        }
        if (i >= MAX_CAMERAS) {
                info ("Ignoring additional USB Camera");
-               up (&state_table_mutex);
                goto bye;
        }
 
@@ -404,7 +414,6 @@
        camera = minor_data [i] = kmalloc (sizeof *camera, GFP_KERNEL);
        if (!camera) {
                err ("no memory!");
-               up (&state_table_mutex);
                goto bye;
        }
 
@@ -471,13 +480,15 @@
        if (!camera->buf) {
                minor_data [subminor] = NULL;
                kfree (camera);
+               camera = NULL;
        } else
                camera->dev = NULL;
 
        info ("USB Camera #%d disconnected", subminor);
        usb_dec_dev_use (dev);
 
-       up (&camera->sem);
+       if (camera != NULL)
+               up (&camera->sem);
        up (&state_table_mutex);
 }
 
@@ -496,6 +507,8 @@
 {
        if (usb_register (&camera_driver) < 0)
                return -1;
+       info(DRIVER_VERSION " " DRIVER_AUTHOR);
+       info(DRIVER_DESC);
        return 0;
 }
 
@@ -504,9 +517,9 @@
        usb_deregister (&camera_driver);
 }
 
-
-MODULE_AUTHOR("David Brownell, [EMAIL PROTECTED]");
-MODULE_DESCRIPTION("USB Camera Driver for Kodak DC-2xx series cameras");
-
 module_init (usb_dc2xx_init);
 module_exit (usb_dc2xx_cleanup);
+
+MODULE_AUTHOR( DRIVER_AUTHOR );
+MODULE_DESCRIPTION( DRIVER_DESC );
+

Reply via email to