Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164548
b: refs/heads/master
c: c4c259b
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Kosina committed Sep 17, 2009
1 parent 122dda0 commit 065417b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d1ff65226c5afe55f9af38a439058f41b71e114f
refs/heads/master: c4c259bcc27c4242b012106afdba183622b1735f
11 changes: 11 additions & 0 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,17 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
}
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 */
static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
Expand Down
16 changes: 5 additions & 11 deletions trunk/drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,13 +1041,6 @@ static void usbhid_stop(struct hid_device *hid)

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;

usb_free_urb(usbhid->urbin);
Expand Down Expand Up @@ -1085,7 +1078,7 @@ static struct hid_ll_driver usb_hid_driver = {
.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_device *dev = interface_to_usbdev(intf);
Expand Down Expand Up @@ -1117,6 +1110,7 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
hid->ff_init = hid_pidff_init;
#ifdef CONFIG_USB_HIDDEV
hid->hiddev_connect = hiddev_connect;
hid->hiddev_disconnect = hiddev_disconnect;
hid->hiddev_hid_event = hiddev_hid_event;
hid->hiddev_report_event = hiddev_report_event;
#endif
Expand Down Expand Up @@ -1177,7 +1171,7 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id)
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 usbhid_device *usbhid;
Expand Down Expand Up @@ -1359,8 +1353,8 @@ MODULE_DEVICE_TABLE (usb, hid_usb_ids);

static struct usb_driver hid_driver = {
.name = "usbhid",
.probe = hid_probe,
.disconnect = hid_disconnect,
.probe = usbhid_probe,
.disconnect = usbhid_disconnect,
#ifdef CONFIG_PM
.suspend = hid_suspend,
.resume = hid_resume,
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ struct hid_device { /* device report descriptor */

/* hiddev event handler */
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,
struct hid_usage *, __s32);
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
Expand Down Expand Up @@ -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_check_keys_pressed(struct hid_device *hid);
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
Expand Down Expand Up @@ -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)
{
hid_disconnect(hdev);
hdev->ll_driver->stop(hdev);
}

Expand Down
7 changes: 0 additions & 7 deletions trunk/net/bluetooth/hidp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,6 @@ static int hidp_session(void *arg)
}

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);
session->hid = NULL;
}
Expand Down Expand Up @@ -747,8 +742,6 @@ static void hidp_stop(struct hid_device *hid)
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);

if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_disconnect(hid);
hid->claimed = 0;
}

Expand Down

0 comments on commit 065417b

Please sign in to comment.