]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/hid/usbhid/hiddev.c
Merge branch 'autosuspend' into for-next
[linux-2.6-omap-h63xx.git] / drivers / hid / usbhid / hiddev.c
index fd7375627e5d69f4fb36527fef0f5f9428e951f9..e9b436d2d94434c17fb1030d50528341edd71659 100644 (file)
@@ -227,12 +227,9 @@ void hiddev_report_event(struct hid_device *hid, struct hid_report *report)
  */
 static int hiddev_fasync(int fd, struct file *file, int on)
 {
-       int retval;
        struct hiddev_list *list = file->private_data;
 
-       retval = fasync_helper(fd, file, on, &list->fasync);
-
-       return retval < 0 ? retval : 0;
+       return fasync_helper(fd, file, on, &list->fasync);
 }
 
 
@@ -891,16 +888,21 @@ int hiddev_connect(struct hid_device *hid, unsigned int force)
        hiddev->hid = hid;
        hiddev->exist = 1;
 
+       /* when lock_kernel() usage is fixed in usb_open(),
+        * we could also fix it here */
+       lock_kernel();
        retval = usb_register_dev(usbhid->intf, &hiddev_class);
        if (retval) {
                err_hid("Not able to get a minor for this device.");
                hid->hiddev = NULL;
+               unlock_kernel();
                kfree(hiddev);
                return -1;
        } else {
                hid->minor = usbhid->intf->minor;
                hiddev_table[usbhid->intf->minor - HIDDEV_MINOR_BASE] = hiddev;
        }
+       unlock_kernel();
 
        return 0;
 }