diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:51:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:51:28 -0400 |
| commit | 50223e486cabdcf7e540e519da1f26bab3084e5d (patch) | |
| tree | c5eedda167c7ea83e342f80a9344646c7a99ba35 /drivers | |
| parent | e258b80e691f1f3ae83a60aa80eaf7322bd55ec4 (diff) | |
| parent | a2d693cf650f000ea22351484ee66cf4c2651eef (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: Remove duplicate Kconfig entry
HID: consolidate connect and disconnect into core code
HID: fix non-atomic allocation in hid_input_report
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/hid/Kconfig | 7 | ||||
| -rw-r--r-- | drivers/hid/hid-core.c | 14 | ||||
| -rw-r--r-- | drivers/hid/usbhid/hid-core.c | 16 |
3 files changed, 17 insertions, 20 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 111afbe8de03..24d90ea246ce 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
| @@ -205,13 +205,6 @@ config HID_NTRIG | |||
| 205 | Support for N-Trig touch screen. | 205 | Support for N-Trig touch screen. |
| 206 | 206 | ||
| 207 | config HID_PANTHERLORD | 207 | config HID_PANTHERLORD |
| 208 | tristate "Pantherlord devices support" if EMBEDDED | ||
| 209 | depends on USB_HID | ||
| 210 | default !EMBEDDED | ||
| 211 | ---help--- | ||
| 212 | Support for PantherLord/GreenAsia based device support. | ||
| 213 | |||
| 214 | config HID_PANTHERLORD | ||
| 215 | tristate "Pantherlord support" if EMBEDDED | 208 | tristate "Pantherlord support" if EMBEDDED |
| 216 | depends on USB_HID | 209 | depends on USB_HID |
| 217 | default !EMBEDDED | 210 | default !EMBEDDED |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 342b7d36d7bb..be34d32906bd 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1089,8 +1089,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i | |||
| 1089 | return -1; | 1089 | return -1; |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, | 1092 | buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); |
| 1093 | interrupt ? GFP_ATOMIC : GFP_KERNEL); | ||
| 1094 | 1093 | ||
| 1095 | if (!buf) { | 1094 | if (!buf) { |
| 1096 | report = hid_get_report(report_enum, data); | 1095 | report = hid_get_report(report_enum, data); |
| @@ -1238,6 +1237,17 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) | |||
| 1238 | } | 1237 | } |
| 1239 | EXPORT_SYMBOL_GPL(hid_connect); | 1238 | EXPORT_SYMBOL_GPL(hid_connect); |
| 1240 | 1239 | ||
| 1240 | void hid_disconnect(struct hid_device *hdev) | ||
| 1241 | { | ||
| 1242 | if (hdev->claimed & HID_CLAIMED_INPUT) | ||
| 1243 | hidinput_disconnect(hdev); | ||
| 1244 | if (hdev->claimed & HID_CLAIMED_HIDDEV) | ||
| 1245 | hdev->hiddev_disconnect(hdev); | ||
| 1246 | if (hdev->claimed & HID_CLAIMED_HIDRAW) | ||
| 1247 | hidraw_disconnect(hdev); | ||
| 1248 | } | ||
| 1249 | EXPORT_SYMBOL_GPL(hid_disconnect); | ||
| 1250 | |||
| 1241 | /* a list of devices for which there is a specialized driver on HID bus */ | 1251 | /* a list of devices for which there is a specialized driver on HID bus */ |
| 1242 | static const struct hid_device_id hid_blacklist[] = { | 1252 | static const struct hid_device_id hid_blacklist[] = { |
| 1243 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, | 1253 | { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, |
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 1b0e07a67d6d..03bd703255a3 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
| @@ -1041,13 +1041,6 @@ static void usbhid_stop(struct hid_device *hid) | |||
| 1041 | 1041 | ||
| 1042 | hid_cancel_delayed_stuff(usbhid); | 1042 | hid_cancel_delayed_stuff(usbhid); |
| 1043 | 1043 | ||
| 1044 | if (hid->claimed & HID_CLAIMED_INPUT) | ||
| 1045 | hidinput_disconnect(hid); | ||
| 1046 | if (hid->claimed & HID_CLAIMED_HIDDEV) | ||
| 1047 | hiddev_disconnect(hid); | ||
| 1048 | if (hid->claimed & HID_CLAIMED_HIDRAW) | ||
| 1049 | hidraw_disconnect(hid); | ||
| 1050 | |||
| 1051 | hid->claimed = 0; | 1044 | hid->claimed = 0; |
| 1052 | 1045 | ||
| 1053 | usb_free_urb(usbhid->urbin); | 1046 | usb_free_urb(usbhid->urbin); |
| @@ -1085,7 +1078,7 @@ static struct hid_ll_driver usb_hid_driver = { | |||
| 1085 | .hidinput_input_event = usb_hidinput_input_event, | 1078 | .hidinput_input_event = usb_hidinput_input_event, |
| 1086 | }; | 1079 | }; |
| 1087 | 1080 | ||
| 1088 | static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) | 1081 | static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id) |
| 1089 | { | 1082 | { |
| 1090 | struct usb_host_interface *interface = intf->cur_altsetting; | 1083 | struct usb_host_interface *interface = intf->cur_altsetting; |
| 1091 | struct usb_device *dev = interface_to_usbdev(intf); | 1084 | struct usb_device *dev = interface_to_usbdev(intf); |
| @@ -1117,6 +1110,7 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
| 1117 | hid->ff_init = hid_pidff_init; | 1110 | hid->ff_init = hid_pidff_init; |
| 1118 | #ifdef CONFIG_USB_HIDDEV | 1111 | #ifdef CONFIG_USB_HIDDEV |
| 1119 | hid->hiddev_connect = hiddev_connect; | 1112 | hid->hiddev_connect = hiddev_connect; |
| 1113 | hid->hiddev_disconnect = hiddev_disconnect; | ||
| 1120 | hid->hiddev_hid_event = hiddev_hid_event; | 1114 | hid->hiddev_hid_event = hiddev_hid_event; |
| 1121 | hid->hiddev_report_event = hiddev_report_event; | 1115 | hid->hiddev_report_event = hiddev_report_event; |
| 1122 | #endif | 1116 | #endif |
| @@ -1177,7 +1171,7 @@ err: | |||
| 1177 | return ret; | 1171 | return ret; |
| 1178 | } | 1172 | } |
| 1179 | 1173 | ||
| 1180 | static void hid_disconnect(struct usb_interface *intf) | 1174 | static void usbhid_disconnect(struct usb_interface *intf) |
| 1181 | { | 1175 | { |
| 1182 | struct hid_device *hid = usb_get_intfdata(intf); | 1176 | struct hid_device *hid = usb_get_intfdata(intf); |
| 1183 | struct usbhid_device *usbhid; | 1177 | struct usbhid_device *usbhid; |
| @@ -1359,8 +1353,8 @@ MODULE_DEVICE_TABLE (usb, hid_usb_ids); | |||
| 1359 | 1353 | ||
| 1360 | static struct usb_driver hid_driver = { | 1354 | static struct usb_driver hid_driver = { |
| 1361 | .name = "usbhid", | 1355 | .name = "usbhid", |
| 1362 | .probe = hid_probe, | 1356 | .probe = usbhid_probe, |
| 1363 | .disconnect = hid_disconnect, | 1357 | .disconnect = usbhid_disconnect, |
| 1364 | #ifdef CONFIG_PM | 1358 | #ifdef CONFIG_PM |
| 1365 | .suspend = hid_suspend, | 1359 | .suspend = hid_suspend, |
| 1366 | .resume = hid_resume, | 1360 | .resume = hid_resume, |
