diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hid-input.c | 22 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 8 | ||||
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 2 |
3 files changed, 25 insertions, 7 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index dd332f28e08c..0b27da7d7497 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -297,7 +297,7 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid, | |||
297 | static int hidinput_getkeycode(struct input_dev *dev, int scancode, | 297 | static int hidinput_getkeycode(struct input_dev *dev, int scancode, |
298 | int *keycode) | 298 | int *keycode) |
299 | { | 299 | { |
300 | struct hid_device *hid = dev->private; | 300 | struct hid_device *hid = input_get_drvdata(dev); |
301 | struct hid_usage *usage; | 301 | struct hid_usage *usage; |
302 | 302 | ||
303 | usage = hidinput_find_key(hid, scancode, 0); | 303 | usage = hidinput_find_key(hid, scancode, 0); |
@@ -311,7 +311,7 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode, | |||
311 | static int hidinput_setkeycode(struct input_dev *dev, int scancode, | 311 | static int hidinput_setkeycode(struct input_dev *dev, int scancode, |
312 | int keycode) | 312 | int keycode) |
313 | { | 313 | { |
314 | struct hid_device *hid = dev->private; | 314 | struct hid_device *hid = input_get_drvdata(dev); |
315 | struct hid_usage *usage; | 315 | struct hid_usage *usage; |
316 | int old_keycode; | 316 | int old_keycode; |
317 | 317 | ||
@@ -1152,7 +1152,7 @@ int hidinput_connect(struct hid_device *hid) | |||
1152 | kfree(hidinput); | 1152 | kfree(hidinput); |
1153 | input_free_device(input_dev); | 1153 | input_free_device(input_dev); |
1154 | err_hid("Out of memory during hid input probe"); | 1154 | err_hid("Out of memory during hid input probe"); |
1155 | return -1; | 1155 | goto out_unwind; |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | input_set_drvdata(input_dev, hid); | 1158 | input_set_drvdata(input_dev, hid); |
@@ -1186,15 +1186,25 @@ int hidinput_connect(struct hid_device *hid) | |||
1186 | * UGCI) cram a lot of unrelated inputs into the | 1186 | * UGCI) cram a lot of unrelated inputs into the |
1187 | * same interface. */ | 1187 | * same interface. */ |
1188 | hidinput->report = report; | 1188 | hidinput->report = report; |
1189 | input_register_device(hidinput->input); | 1189 | if (input_register_device(hidinput->input)) |
1190 | goto out_cleanup; | ||
1190 | hidinput = NULL; | 1191 | hidinput = NULL; |
1191 | } | 1192 | } |
1192 | } | 1193 | } |
1193 | 1194 | ||
1194 | if (hidinput) | 1195 | if (hidinput && input_register_device(hidinput->input)) |
1195 | input_register_device(hidinput->input); | 1196 | goto out_cleanup; |
1196 | 1197 | ||
1197 | return 0; | 1198 | return 0; |
1199 | |||
1200 | out_cleanup: | ||
1201 | input_free_device(hidinput->input); | ||
1202 | kfree(hidinput); | ||
1203 | out_unwind: | ||
1204 | /* unwind the ones we already registered */ | ||
1205 | hidinput_disconnect(hid); | ||
1206 | |||
1207 | return -1; | ||
1198 | } | 1208 | } |
1199 | EXPORT_SYMBOL_GPL(hidinput_connect); | 1209 | EXPORT_SYMBOL_GPL(hidinput_connect); |
1200 | 1210 | ||
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 41a59a80e7ed..a2552856476b 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -129,6 +129,11 @@ | |||
129 | #define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053 | 129 | #define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053 |
130 | #define USB_DEVICE_ID_PHIDGET_MOTORCONTROL 0x0058 | 130 | #define USB_DEVICE_ID_PHIDGET_MOTORCONTROL 0x0058 |
131 | 131 | ||
132 | #define USB_VENDOR_ID_GOTOP 0x08f2 | ||
133 | #define USB_DEVICE_ID_SUPER_Q2 0x007f | ||
134 | #define USB_DEVICE_ID_GOGOPEN 0x00ce | ||
135 | #define USB_DEVICE_ID_PENPOWER 0x00f4 | ||
136 | |||
132 | #define USB_VENDOR_ID_GRIFFIN 0x077d | 137 | #define USB_VENDOR_ID_GRIFFIN 0x077d |
133 | #define USB_DEVICE_ID_POWERMATE 0x0410 | 138 | #define USB_DEVICE_ID_POWERMATE 0x0410 |
134 | #define USB_DEVICE_ID_SOUNDKNOB 0x04AA | 139 | #define USB_DEVICE_ID_SOUNDKNOB 0x04AA |
@@ -415,6 +420,9 @@ static const struct hid_blacklist { | |||
415 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_7_IF_KIT, HID_QUIRK_IGNORE }, | 420 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_7_IF_KIT, HID_QUIRK_IGNORE }, |
416 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE }, | 421 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE }, |
417 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL, HID_QUIRK_IGNORE }, | 422 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL, HID_QUIRK_IGNORE }, |
423 | { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2, HID_QUIRK_IGNORE }, | ||
424 | { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN, HID_QUIRK_IGNORE }, | ||
425 | { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER, HID_QUIRK_IGNORE }, | ||
418 | { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE }, | 426 | { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE }, |
419 | { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE }, | 427 | { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE }, |
420 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE }, | 428 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE }, |
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 9837adcb17e9..5fc4019956ba 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -743,7 +743,7 @@ inval: | |||
743 | static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 743 | static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
744 | { | 744 | { |
745 | struct inode *inode = file->f_path.dentry->d_inode; | 745 | struct inode *inode = file->f_path.dentry->d_inode; |
746 | return hiddev_ioctl(inode, file, cmd, compat_ptr(arg)); | 746 | return hiddev_ioctl(inode, file, cmd, (unsigned long)compat_ptr(arg)); |
747 | } | 747 | } |
748 | #endif | 748 | #endif |
749 | 749 | ||