HID: hid-elecom: extend to fix descriptor for HUGE trackball
[sfrench/cifs-2.6.git] / drivers / hid / hid-core.c
index 9017dcc14502d7236ff48a03457cb67a7f9d0a5e..330ca983828ba6d11feaf5538841a6810d84f5c6 100644 (file)
@@ -1982,6 +1982,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_T100_KEYBOARD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_ASUS_MD_5112) },
        { HID_USB_DEVICE(USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_ASUS_MD_5110) },
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_T100CHI_KEYBOARD) },
 #endif
 #if IS_ENABLED(CONFIG_HID_AUREAL)
        { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
@@ -2031,6 +2032,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) },
 #endif
 #if IS_ENABLED(CONFIG_HID_ELO)
        { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },
@@ -2487,11 +2490,9 @@ static int hid_device_probe(struct device *dev)
        const struct hid_device_id *id;
        int ret = 0;
 
-       if (down_interruptible(&hdev->driver_lock))
-               return -EINTR;
        if (down_interruptible(&hdev->driver_input_lock)) {
                ret = -EINTR;
-               goto unlock_driver_lock;
+               goto end;
        }
        hdev->io_started = false;
 
@@ -2518,8 +2519,7 @@ static int hid_device_probe(struct device *dev)
 unlock:
        if (!hdev->io_started)
                up(&hdev->driver_input_lock);
-unlock_driver_lock:
-       up(&hdev->driver_lock);
+end:
        return ret;
 }
 
@@ -2529,11 +2529,9 @@ static int hid_device_remove(struct device *dev)
        struct hid_driver *hdrv;
        int ret = 0;
 
-       if (down_interruptible(&hdev->driver_lock))
-               return -EINTR;
        if (down_interruptible(&hdev->driver_input_lock)) {
                ret = -EINTR;
-               goto unlock_driver_lock;
+               goto end;
        }
        hdev->io_started = false;
 
@@ -2549,8 +2547,7 @@ static int hid_device_remove(struct device *dev)
 
        if (!hdev->io_started)
                up(&hdev->driver_input_lock);
-unlock_driver_lock:
-       up(&hdev->driver_lock);
+end:
        return ret;
 }
 
@@ -3008,7 +3005,6 @@ struct hid_device *hid_allocate_device(void)
        init_waitqueue_head(&hdev->debug_wait);
        INIT_LIST_HEAD(&hdev->debug_list);
        spin_lock_init(&hdev->debug_list_lock);
-       sema_init(&hdev->driver_lock, 1);
        sema_init(&hdev->driver_input_lock, 1);
        mutex_init(&hdev->ll_open_lock);