mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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
This commit is contained in:
commit
50223e486c
@ -204,13 +204,6 @@ config HID_NTRIG
|
|||||||
---help---
|
---help---
|
||||||
Support for N-Trig touch screen.
|
Support for N-Trig touch screen.
|
||||||
|
|
||||||
config HID_PANTHERLORD
|
|
||||||
tristate "Pantherlord devices support" if EMBEDDED
|
|
||||||
depends on USB_HID
|
|
||||||
default !EMBEDDED
|
|
||||||
---help---
|
|
||||||
Support for PantherLord/GreenAsia based device support.
|
|
||||||
|
|
||||||
config HID_PANTHERLORD
|
config HID_PANTHERLORD
|
||||||
tristate "Pantherlord support" if EMBEDDED
|
tristate "Pantherlord support" if EMBEDDED
|
||||||
depends on USB_HID
|
depends on USB_HID
|
||||||
|
@ -1089,8 +1089,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE,
|
buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC);
|
||||||
interrupt ? GFP_ATOMIC : GFP_KERNEL);
|
|
||||||
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
report = hid_get_report(report_enum, data);
|
report = hid_get_report(report_enum, data);
|
||||||
@ -1238,6 +1237,17 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(hid_connect);
|
EXPORT_SYMBOL_GPL(hid_connect);
|
||||||
|
|
||||||
|
void hid_disconnect(struct hid_device *hdev)
|
||||||
|
{
|
||||||
|
if (hdev->claimed & HID_CLAIMED_INPUT)
|
||||||
|
hidinput_disconnect(hdev);
|
||||||
|
if (hdev->claimed & HID_CLAIMED_HIDDEV)
|
||||||
|
hdev->hiddev_disconnect(hdev);
|
||||||
|
if (hdev->claimed & HID_CLAIMED_HIDRAW)
|
||||||
|
hidraw_disconnect(hdev);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(hid_disconnect);
|
||||||
|
|
||||||
/* a list of devices for which there is a specialized driver on HID bus */
|
/* a list of devices for which there is a specialized driver on HID bus */
|
||||||
static const struct hid_device_id hid_blacklist[] = {
|
static const struct hid_device_id hid_blacklist[] = {
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
|
||||||
|
@ -1041,13 +1041,6 @@ static void usbhid_stop(struct hid_device *hid)
|
|||||||
|
|
||||||
hid_cancel_delayed_stuff(usbhid);
|
hid_cancel_delayed_stuff(usbhid);
|
||||||
|
|
||||||
if (hid->claimed & HID_CLAIMED_INPUT)
|
|
||||||
hidinput_disconnect(hid);
|
|
||||||
if (hid->claimed & HID_CLAIMED_HIDDEV)
|
|
||||||
hiddev_disconnect(hid);
|
|
||||||
if (hid->claimed & HID_CLAIMED_HIDRAW)
|
|
||||||
hidraw_disconnect(hid);
|
|
||||||
|
|
||||||
hid->claimed = 0;
|
hid->claimed = 0;
|
||||||
|
|
||||||
usb_free_urb(usbhid->urbin);
|
usb_free_urb(usbhid->urbin);
|
||||||
@ -1085,7 +1078,7 @@ static struct hid_ll_driver usb_hid_driver = {
|
|||||||
.hidinput_input_event = usb_hidinput_input_event,
|
.hidinput_input_event = usb_hidinput_input_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||||
{
|
{
|
||||||
struct usb_host_interface *interface = intf->cur_altsetting;
|
struct usb_host_interface *interface = intf->cur_altsetting;
|
||||||
struct usb_device *dev = interface_to_usbdev(intf);
|
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)
|
|||||||
hid->ff_init = hid_pidff_init;
|
hid->ff_init = hid_pidff_init;
|
||||||
#ifdef CONFIG_USB_HIDDEV
|
#ifdef CONFIG_USB_HIDDEV
|
||||||
hid->hiddev_connect = hiddev_connect;
|
hid->hiddev_connect = hiddev_connect;
|
||||||
|
hid->hiddev_disconnect = hiddev_disconnect;
|
||||||
hid->hiddev_hid_event = hiddev_hid_event;
|
hid->hiddev_hid_event = hiddev_hid_event;
|
||||||
hid->hiddev_report_event = hiddev_report_event;
|
hid->hiddev_report_event = hiddev_report_event;
|
||||||
#endif
|
#endif
|
||||||
@ -1177,7 +1171,7 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hid_disconnect(struct usb_interface *intf)
|
static void usbhid_disconnect(struct usb_interface *intf)
|
||||||
{
|
{
|
||||||
struct hid_device *hid = usb_get_intfdata(intf);
|
struct hid_device *hid = usb_get_intfdata(intf);
|
||||||
struct usbhid_device *usbhid;
|
struct usbhid_device *usbhid;
|
||||||
@ -1359,8 +1353,8 @@ MODULE_DEVICE_TABLE (usb, hid_usb_ids);
|
|||||||
|
|
||||||
static struct usb_driver hid_driver = {
|
static struct usb_driver hid_driver = {
|
||||||
.name = "usbhid",
|
.name = "usbhid",
|
||||||
.probe = hid_probe,
|
.probe = usbhid_probe,
|
||||||
.disconnect = hid_disconnect,
|
.disconnect = usbhid_disconnect,
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
.suspend = hid_suspend,
|
.suspend = hid_suspend,
|
||||||
.resume = hid_resume,
|
.resume = hid_resume,
|
||||||
|
@ -494,6 +494,7 @@ struct hid_device { /* device report descriptor */
|
|||||||
|
|
||||||
/* hiddev event handler */
|
/* hiddev event handler */
|
||||||
int (*hiddev_connect)(struct hid_device *, unsigned int);
|
int (*hiddev_connect)(struct hid_device *, unsigned int);
|
||||||
|
void (*hiddev_disconnect)(struct hid_device *);
|
||||||
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
|
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
|
||||||
struct hid_usage *, __s32);
|
struct hid_usage *, __s32);
|
||||||
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
|
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
|
||||||
@ -691,6 +692,7 @@ struct hid_device *hid_allocate_device(void);
|
|||||||
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
|
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
|
||||||
int hid_check_keys_pressed(struct hid_device *hid);
|
int hid_check_keys_pressed(struct hid_device *hid);
|
||||||
int hid_connect(struct hid_device *hid, unsigned int connect_mask);
|
int hid_connect(struct hid_device *hid, unsigned int connect_mask);
|
||||||
|
void hid_disconnect(struct hid_device *hid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hid_map_usage - map usage input bits
|
* hid_map_usage - map usage input bits
|
||||||
@ -800,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev,
|
|||||||
*/
|
*/
|
||||||
static inline void hid_hw_stop(struct hid_device *hdev)
|
static inline void hid_hw_stop(struct hid_device *hdev)
|
||||||
{
|
{
|
||||||
|
hid_disconnect(hdev);
|
||||||
hdev->ll_driver->stop(hdev);
|
hdev->ll_driver->stop(hdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,11 +577,6 @@ static int hidp_session(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (session->hid) {
|
if (session->hid) {
|
||||||
if (session->hid->claimed & HID_CLAIMED_INPUT)
|
|
||||||
hidinput_disconnect(session->hid);
|
|
||||||
if (session->hid->claimed & HID_CLAIMED_HIDRAW)
|
|
||||||
hidraw_disconnect(session->hid);
|
|
||||||
|
|
||||||
hid_destroy_device(session->hid);
|
hid_destroy_device(session->hid);
|
||||||
session->hid = NULL;
|
session->hid = NULL;
|
||||||
}
|
}
|
||||||
@ -747,8 +742,6 @@ static void hidp_stop(struct hid_device *hid)
|
|||||||
skb_queue_purge(&session->ctrl_transmit);
|
skb_queue_purge(&session->ctrl_transmit);
|
||||||
skb_queue_purge(&session->intr_transmit);
|
skb_queue_purge(&session->intr_transmit);
|
||||||
|
|
||||||
if (hid->claimed & HID_CLAIMED_INPUT)
|
|
||||||
hidinput_disconnect(hid);
|
|
||||||
hid->claimed = 0;
|
hid->claimed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user