]> err.no Git - linux-2.6/blobdiff - drivers/usb/misc/sisusbvga/sisusb.c
Merge commit 'origin/master'
[linux-2.6] / drivers / usb / misc / sisusbvga / sisusb.c
index 9244d067cec1d9e3232d3379bae6cf46fa998925..fbace41a7cba4418dc8602f70eae8614b0db33c7 100644 (file)
@@ -323,7 +323,7 @@ sisusb_bulkin_msg(struct sisusb_usb_data *sisusb, unsigned int pipe, void *data,
                        usb_kill_urb(urb);
                        retval = -ETIMEDOUT;
                } else {
-                       /* URB completed within timout */
+                       /* URB completed within timeout */
                        retval = urb->status;
                        readbytes = urb->actual_length;
                }
@@ -2982,9 +2982,8 @@ sisusb_handle_command(struct sisusb_usb_data *sisusb, struct sisusb_command *y,
        return retval;
 }
 
-static int
-sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-                                                       unsigned long arg)
+static long
+sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct sisusb_usb_data *sisusb;
        struct sisusb_info x;
@@ -2995,6 +2994,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
        if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
                return -ENODEV;
 
+       lock_kernel();
        mutex_lock(&sisusb->lock);
 
        /* Sanity check */
@@ -3053,6 +3053,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 
 err_out:
        mutex_unlock(&sisusb->lock);
+       unlock_kernel();
        return retval;
 }
 
@@ -3066,9 +3067,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
                case SISUSB_GET_CONFIG_SIZE:
                case SISUSB_GET_CONFIG:
                case SISUSB_COMMAND:
-                       lock_kernel();
-                       retval = sisusb_ioctl(f->f_path.dentry->d_inode, f, cmd, arg);
-                       unlock_kernel();
+                       retval = sisusb_ioctl(f, cmd, arg);
                        return retval;
 
                default:
@@ -3087,7 +3086,7 @@ static const struct file_operations usb_sisusb_fops = {
 #ifdef SISUSB_NEW_CONFIG_COMPAT
        .compat_ioctl = sisusb_compat_ioctl,
 #endif
-       .ioctl =        sisusb_ioctl
+       .unlocked_ioctl = sisusb_ioctl
 };
 
 static struct usb_class_driver usb_sisusb_class = {
@@ -3195,20 +3194,6 @@ static int sisusb_probe(struct usb_interface *intf,
 
        sisusb->present = 1;
 
-#ifdef SISUSB_OLD_CONFIG_COMPAT
-       {
-       int ret;
-       /* Our ioctls are all "32/64bit compatible" */
-       ret =  register_ioctl32_conversion(SISUSB_GET_CONFIG_SIZE, NULL);
-       ret |= register_ioctl32_conversion(SISUSB_GET_CONFIG,      NULL);
-       ret |= register_ioctl32_conversion(SISUSB_COMMAND,         NULL);
-       if (ret)
-               dev_err(&sisusb->sisusb_dev->dev, "Error registering ioctl32 translations\n");
-       else
-               sisusb->ioctl32registered = 1;
-       }
-#endif
-
        if (dev->speed == USB_SPEED_HIGH) {
                int initscreen = 1;
 #ifdef INCL_SISUSB_CON
@@ -3271,19 +3256,6 @@ static void sisusb_disconnect(struct usb_interface *intf)
 
        usb_set_intfdata(intf, NULL);
 
-#ifdef SISUSB_OLD_CONFIG_COMPAT
-       if (sisusb->ioctl32registered) {
-               int ret;
-               sisusb->ioctl32registered = 0;
-               ret =  unregister_ioctl32_conversion(SISUSB_GET_CONFIG_SIZE);
-               ret |= unregister_ioctl32_conversion(SISUSB_GET_CONFIG);
-               ret |= unregister_ioctl32_conversion(SISUSB_COMMAND);
-               if (ret) {
-                       dev_err(&sisusb->sisusb_dev->dev, "Error unregistering ioctl32 translations\n");
-               }
-       }
-#endif
-
        sisusb->present = 0;
        sisusb->ready = 0;
 
@@ -3291,8 +3263,6 @@ static void sisusb_disconnect(struct usb_interface *intf)
 
        /* decrement our usage count */
        kref_put(&sisusb->kref, sisusb_delete);
-
-       dev_info(&sisusb->sisusb_dev->dev, "Disconnected\n");
 }
 
 static struct usb_device_id sisusb_table [] = {