]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/misc/ldusb.c
USB: remove vernier labpro from ldusb
[linux-2.6-omap-h63xx.git] / drivers / usb / misc / ldusb.c
index c730d20eec66cc6c3f4517626b74c696c4e15731..ad4fb15b5dcbcaa6a12b26037880e4121900d9a2 100644 (file)
 #define USB_DEVICE_ID_LD_MACHINETEST   0x2040  /* USB Product ID of Machine Test System */
 
 #define USB_VENDOR_ID_VERNIER          0x08f7
-#define USB_DEVICE_ID_VERNIER_LABPRO   0x0001
 #define USB_DEVICE_ID_VERNIER_GOTEMP   0x0002
 #define USB_DEVICE_ID_VERNIER_SKIP     0x0003
 #define USB_DEVICE_ID_VERNIER_CYCLOPS  0x0004
 #define USB_DEVICE_ID_VERNIER_LCSPEC   0x0006
 
-#define USB_VENDOR_ID_MICROCHIP                0x04d8
-#define USB_DEVICE_ID_PICDEM           0x000c
-
 #ifdef CONFIG_USB_DYNAMIC_MINORS
 #define USB_LD_MINOR_BASE      0
 #else
@@ -88,11 +84,9 @@ static struct usb_device_id ld_usb_table [] = {
        { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_NETWORKANALYSER) },
        { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERCONTROL) },
        { USB_DEVICE(USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST) },
-       { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS) },
-       { USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICDEM) },
        { USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LCSPEC) },
        { }                                     /* Terminating entry */
 };
@@ -148,7 +142,7 @@ MODULE_PARM_DESC(min_interrupt_out_interval, "Minimum interrupt out interval in
 
 /* Structure to hold all of our device specific stuff */
 struct ld_usb {
-       struct semaphore        sem;            /* locks this structure */
+       struct mutex            mutex;          /* locks this structure */
        struct usb_interface*   intf;           /* save off the usb interface pointer */
 
        int                     open_count;     /* number of times this port has been opened */
@@ -231,7 +225,7 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
                        goto exit;
                } else {
                        dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n",
-                                __FUNCTION__, status);
+                                __func__, status);
                        spin_lock(&dev->rbsl);
                        goto resubmit; /* maybe we can recover */
                }
@@ -247,7 +241,7 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
                        memcpy(actual_buffer+1, dev->interrupt_in_buffer, urb->actual_length);
                        dev->ring_head = next_ring_head;
                        dbg_info(&dev->intf->dev, "%s: received %d bytes\n",
-                                __FUNCTION__, urb->actual_length);
+                                __func__, urb->actual_length);
                } else {
                        dev_warn(&dev->intf->dev,
                                 "Ring buffer overflow, %d bytes dropped\n",
@@ -286,7 +280,7 @@ static void ld_usb_interrupt_out_callback(struct urb *urb)
                        status == -ESHUTDOWN))
                dbg_info(&dev->intf->dev,
                         "%s - nonzero write interrupt status received: %d\n",
-                        __FUNCTION__, status);
+                        __func__, status);
 
        dev->interrupt_out_busy = 0;
        wake_up_interruptible(&dev->write_wait);
@@ -309,7 +303,7 @@ static int ld_usb_open(struct inode *inode, struct file *file)
 
        if (!interface) {
                err("%s - error, can't find device for minor %d\n",
-                    __FUNCTION__, subminor);
+                    __func__, subminor);
                return -ENODEV;
        }
 
@@ -319,7 +313,7 @@ static int ld_usb_open(struct inode *inode, struct file *file)
                return -ENODEV;
 
        /* lock this device */
-       if (down_interruptible(&dev->sem))
+       if (mutex_lock_interruptible(&dev->mutex))
                return -ERESTARTSYS;
 
        /* allow opening only once */
@@ -358,7 +352,7 @@ static int ld_usb_open(struct inode *inode, struct file *file)
        file->private_data = dev;
 
 unlock_exit:
-       up(&dev->sem);
+       mutex_unlock(&dev->mutex);
 
        return retval;
 }
@@ -378,7 +372,7 @@ static int ld_usb_release(struct inode *inode, struct file *file)
                goto exit;
        }
 
-       if (down_interruptible(&dev->sem)) {
+       if (mutex_lock_interruptible(&dev->mutex)) {
                retval = -ERESTARTSYS;
                goto exit;
        }
@@ -389,7 +383,7 @@ static int ld_usb_release(struct inode *inode, struct file *file)
        }
        if (dev->intf == NULL) {
                /* the device was unplugged before the file was released */
-               up(&dev->sem);
+               mutex_unlock(&dev->mutex);
                /* unlock here as ld_usb_delete frees dev */
                ld_usb_delete(dev);
                goto exit;
@@ -402,7 +396,7 @@ static int ld_usb_release(struct inode *inode, struct file *file)
        dev->open_count = 0;
 
 unlock_exit:
-       up(&dev->sem);
+       mutex_unlock(&dev->mutex);
 
 exit:
        return retval;
@@ -448,7 +442,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
                goto exit;
 
        /* lock this object */
-       if (down_interruptible(&dev->sem)) {
+       if (mutex_lock_interruptible(&dev->mutex)) {
                retval = -ERESTARTSYS;
                goto exit;
        }
@@ -505,7 +499,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
 
 unlock_exit:
        /* unlock the device */
-       up(&dev->sem);
+       mutex_unlock(&dev->mutex);
 
 exit:
        return retval;
@@ -528,7 +522,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
                goto exit;
 
        /* lock this object */
-       if (down_interruptible(&dev->sem)) {
+       if (mutex_lock_interruptible(&dev->mutex)) {
                retval = -ERESTARTSYS;
                goto exit;
        }
@@ -556,7 +550,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
        bytes_to_write = min(count, write_buffer_size*dev->interrupt_out_endpoint_size);
        if (bytes_to_write < count)
                dev_warn(&dev->intf->dev, "Write buffer overflow, %zd bytes dropped\n",count-bytes_to_write);
-       dbg_info(&dev->intf->dev, "%s: count = %zd, bytes_to_write = %zd\n", __FUNCTION__, count, bytes_to_write);
+       dbg_info(&dev->intf->dev, "%s: count = %zd, bytes_to_write = %zd\n", __func__, count, bytes_to_write);
 
        if (copy_from_user(dev->interrupt_out_buffer, buffer, bytes_to_write)) {
                retval = -EFAULT;
@@ -602,7 +596,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
 
 unlock_exit:
        /* unlock the device */
-       up(&dev->sem);
+       mutex_unlock(&dev->mutex);
 
 exit:
        return retval;
@@ -651,7 +645,7 @@ static int ld_usb_probe(struct usb_interface *intf, const struct usb_device_id *
                dev_err(&intf->dev, "Out of memory\n");
                goto exit;
        }
-       init_MUTEX(&dev->sem);
+       mutex_init(&dev->mutex);
        spin_lock_init(&dev->rbsl);
        dev->intf = intf;
        init_waitqueue_head(&dev->read_wait);
@@ -765,15 +759,15 @@ static void ld_usb_disconnect(struct usb_interface *intf)
        /* give back our minor */
        usb_deregister_dev(intf, &ld_usb_class);
 
-       down(&dev->sem);
+       mutex_lock(&dev->mutex);
 
        /* if the device is not opened, then we clean up right now */
        if (!dev->open_count) {
-               up(&dev->sem);
+               mutex_unlock(&dev->mutex);
                ld_usb_delete(dev);
        } else {
                dev->intf = NULL;
-               up(&dev->sem);
+               mutex_unlock(&dev->mutex);
        }
 
        dev_info(&intf->dev, "LD USB Device #%d now disconnected\n",