Skip to content

Commit

Permalink
HID: make timeout HZ independent
Browse files Browse the repository at this point in the history
wait_event_interruptible_timeout() expects a timeout in jiffies so the
numeric constant becomes HZ dependent - put it through msecs_to_jiffies()
to make it HZ independent.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Nicholas Mc Guire authored and Jiri Kosina committed May 7, 2015
1 parent 8de29a3 commit e039306
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-lg.c
Expand Up @@ -700,7 +700,8 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
/* insert a little delay of 10 jiffies ~ 40ms */
wait_queue_head_t wait;
init_waitqueue_head (&wait);
wait_event_interruptible_timeout(wait, 0, 10);
wait_event_interruptible_timeout(wait, 0,
msecs_to_jiffies(40));

/* Select random Address */
buf[1] = 0xB2;
Expand Down

0 comments on commit e039306

Please sign in to comment.