Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91855
b: refs/heads/master
c: 1d1bdd2
h: refs/heads/master
i:
  91853: b7d5ddd
  91851: b04a097
  91847: e91d364
  91839: 02fc839
v: v3
  • Loading branch information
Jiri Slaby authored and Jiri Kosina committed Apr 22, 2008
1 parent ea2a13d commit 75f673f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 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: 1b184cf37f5cf098f07725b483a2055e95725476
refs/heads/master: 1d1bdd20008416a744c0c844e231e7ba69c11699
16 changes: 8 additions & 8 deletions trunk/drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ static void hid_irq_out(struct urb *urb)
if (usbhid->outhead != usbhid->outtail) {
if (hid_submit_out(hid)) {
clear_bit(HID_OUT_RUNNING, &usbhid->iofl);
wake_up(&hid->wait);
wake_up(&usbhid->wait);
}
spin_unlock_irqrestore(&usbhid->outlock, flags);
return;
}

clear_bit(HID_OUT_RUNNING, &usbhid->iofl);
spin_unlock_irqrestore(&usbhid->outlock, flags);
wake_up(&hid->wait);
wake_up(&usbhid->wait);
}

/*
Expand Down Expand Up @@ -391,15 +391,15 @@ static void hid_ctrl(struct urb *urb)
if (usbhid->ctrlhead != usbhid->ctrltail) {
if (hid_submit_ctrl(hid)) {
clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
wake_up(&hid->wait);
wake_up(&usbhid->wait);
}
spin_unlock_irqrestore(&usbhid->ctrllock, flags);
return;
}

clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
spin_unlock_irqrestore(&usbhid->ctrllock, flags);
wake_up(&hid->wait);
wake_up(&usbhid->wait);
}

void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
Expand Down Expand Up @@ -478,8 +478,9 @@ int usbhid_wait_io(struct hid_device *hid)
{
struct usbhid_device *usbhid = hid->driver_data;

if (!wait_event_timeout(hid->wait, (!test_bit(HID_CTRL_RUNNING, &usbhid->iofl) &&
!test_bit(HID_OUT_RUNNING, &usbhid->iofl)),
if (!wait_event_timeout(usbhid->wait,
(!test_bit(HID_CTRL_RUNNING, &usbhid->iofl) &&
!test_bit(HID_OUT_RUNNING, &usbhid->iofl)),
10*HZ)) {
dbg_hid("timeout waiting for ctrl or out queue to clear\n");
return -1;
Expand Down Expand Up @@ -869,8 +870,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
goto fail;
}

init_waitqueue_head(&hid->wait);

init_waitqueue_head(&usbhid->wait);
INIT_WORK(&usbhid->reset_work, hid_reset);
setup_timer(&usbhid->io_retry, hid_retry_timeout, (unsigned long) hid);

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/hid/usbhid/usbhid.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/input.h>

Expand Down Expand Up @@ -77,7 +78,7 @@ struct usbhid_device {
unsigned long stop_retry; /* Time to give up, in jiffies */
unsigned int retry_delay; /* Delay length in ms */
struct work_struct reset_work; /* Task context for resets */

wait_queue_head_t wait; /* For sleeping */
};

#define hid_to_usb_dev(hid_dev) \
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ struct hid_device { /* device report descriptor */
void *hidraw;
int minor; /* Hiddev minor number */

wait_queue_head_t wait; /* For sleeping */

int open; /* is the device open by anyone? */
char name[128]; /* Device name */
char phys[64]; /* Device physical location */
Expand Down

0 comments on commit 75f673f

Please sign in to comment.