Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68658
b: refs/heads/master
c: 933e318
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Jiri Kosina committed Oct 14, 2007
1 parent 19bb733 commit be106f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 1fe8736da695c2b14961438c73d5600538bd92d9
refs/heads/master: 933e3187d0042d9381d932757dc1f931d984e56d
16 changes: 14 additions & 2 deletions trunk/drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,16 @@ static int hid_get_class_descriptor(struct usb_device *dev, int ifnum,

int usbhid_open(struct hid_device *hid)
{
++hid->open;
struct usbhid_device *usbhid = hid->driver_data;
int res;

if (!hid->open++) {
res = usb_autopm_get_interface(usbhid->intf);
if (res < 0) {
hid->open--;
return -EIO;
}
}
if (hid_start_in(hid))
hid_io_error(hid);
return 0;
Expand All @@ -522,8 +531,10 @@ void usbhid_close(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;

if (!--hid->open)
if (!--hid->open) {
usb_kill_urb(usbhid->urbin);
usb_autopm_put_interface(usbhid->intf);
}
}

/*
Expand Down Expand Up @@ -1048,6 +1059,7 @@ static struct usb_driver hid_driver = {
.pre_reset = hid_pre_reset,
.post_reset = hid_post_reset,
.id_table = hid_usb_ids,
.supports_autosuspend = 1,
};

static int __init hid_init(void)
Expand Down

0 comments on commit be106f4

Please sign in to comment.