Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+20 -27
-7
drivers/hid/Kconfig
··· 205 205 Support for N-Trig touch screen. 206 206 207 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 208 tristate "Pantherlord support" if EMBEDDED 216 209 depends on USB_HID 217 210 default !EMBEDDED
+12 -2
drivers/hid/hid-core.c
··· 1089 1089 return -1; 1090 1090 } 1091 1091 1092 - buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, 1093 - interrupt ? GFP_ATOMIC : GFP_KERNEL); 1092 + buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); 1094 1093 1095 1094 if (!buf) { 1096 1095 report = hid_get_report(report_enum, data); ··· 1236 1237 return 0; 1237 1238 } 1238 1239 EXPORT_SYMBOL_GPL(hid_connect); 1240 + 1241 + void hid_disconnect(struct hid_device *hdev) 1242 + { 1243 + if (hdev->claimed & HID_CLAIMED_INPUT) 1244 + hidinput_disconnect(hdev); 1245 + if (hdev->claimed & HID_CLAIMED_HIDDEV) 1246 + hdev->hiddev_disconnect(hdev); 1247 + if (hdev->claimed & HID_CLAIMED_HIDRAW) 1248 + hidraw_disconnect(hdev); 1249 + } 1250 + EXPORT_SYMBOL_GPL(hid_disconnect); 1239 1251 1240 1252 /* a list of devices for which there is a specialized driver on HID bus */ 1241 1253 static const struct hid_device_id hid_blacklist[] = {
+5 -11
drivers/hid/usbhid/hid-core.c
··· 1041 1041 1042 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 1044 hid->claimed = 0; 1052 1045 1053 1046 usb_free_urb(usbhid->urbin); ··· 1078 1085 .hidinput_input_event = usb_hidinput_input_event, 1079 1086 }; 1080 1087 1081 - static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) 1088 + static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id) 1082 1089 { 1083 1090 struct usb_host_interface *interface = intf->cur_altsetting; 1084 1091 struct usb_device *dev = interface_to_usbdev(intf); ··· 1110 1117 hid->ff_init = hid_pidff_init; 1111 1118 #ifdef CONFIG_USB_HIDDEV 1112 1119 hid->hiddev_connect = hiddev_connect; 1120 + hid->hiddev_disconnect = hiddev_disconnect; 1113 1121 hid->hiddev_hid_event = hiddev_hid_event; 1114 1122 hid->hiddev_report_event = hiddev_report_event; 1115 1123 #endif ··· 1171 1177 return ret; 1172 1178 } 1173 1179 1174 - static void hid_disconnect(struct usb_interface *intf) 1180 + static void usbhid_disconnect(struct usb_interface *intf) 1175 1181 { 1176 1182 struct hid_device *hid = usb_get_intfdata(intf); 1177 1183 struct usbhid_device *usbhid; ··· 1353 1359 1354 1360 static struct usb_driver hid_driver = { 1355 1361 .name = "usbhid", 1356 - .probe = hid_probe, 1357 - .disconnect = hid_disconnect, 1362 + .probe = usbhid_probe, 1363 + .disconnect = usbhid_disconnect, 1358 1364 #ifdef CONFIG_PM 1359 1365 .suspend = hid_suspend, 1360 1366 .resume = hid_resume,
+3
include/linux/hid.h
··· 494 494 495 495 /* hiddev event handler */ 496 496 int (*hiddev_connect)(struct hid_device *, unsigned int); 497 + void (*hiddev_disconnect)(struct hid_device *); 497 498 void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field, 498 499 struct hid_usage *, __s32); 499 500 void (*hiddev_report_event) (struct hid_device *, struct hid_report *); ··· 692 691 int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); 693 692 int hid_check_keys_pressed(struct hid_device *hid); 694 693 int hid_connect(struct hid_device *hid, unsigned int connect_mask); 694 + void hid_disconnect(struct hid_device *hid); 695 695 696 696 /** 697 697 * hid_map_usage - map usage input bits ··· 802 800 */ 803 801 static inline void hid_hw_stop(struct hid_device *hdev) 804 802 { 803 + hid_disconnect(hdev); 805 804 hdev->ll_driver->stop(hdev); 806 805 } 807 806
-7
net/bluetooth/hidp/core.c
··· 577 577 } 578 578 579 579 if (session->hid) { 580 - if (session->hid->claimed & HID_CLAIMED_INPUT) 581 - hidinput_disconnect(session->hid); 582 - if (session->hid->claimed & HID_CLAIMED_HIDRAW) 583 - hidraw_disconnect(session->hid); 584 - 585 580 hid_destroy_device(session->hid); 586 581 session->hid = NULL; 587 582 } ··· 742 747 skb_queue_purge(&session->ctrl_transmit); 743 748 skb_queue_purge(&session->intr_transmit); 744 749 745 - if (hid->claimed & HID_CLAIMED_INPUT) 746 - hidinput_disconnect(hid); 747 750 hid->claimed = 0; 748 751 } 749 752