diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-02-06 04:50:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-18 11:20:34 -0400 |
commit | 9751afbbb02d7a1c0f57191b8423948344a7ed86 (patch) | |
tree | 2c06527a23d79246e88d5d9abddf2c5472176863 | |
parent | 1dc6120ef7f003305d99ef12f598a6b05eacc38c (diff) |
USB: image: use msecs_to_jiffies for time conversion
This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/image/mdc800.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/image/mdc800.c b/drivers/usb/image/mdc800.c index a62865af53cc..5cf2633cdb04 100644 --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c | |||
@@ -347,7 +347,8 @@ static int mdc800_usb_waitForIRQ (int mode, int msec) | |||
347 | { | 347 | { |
348 | mdc800->camera_request_ready=1+mode; | 348 | mdc800->camera_request_ready=1+mode; |
349 | 349 | ||
350 | wait_event_timeout(mdc800->irq_wait, mdc800->irq_woken, msec*HZ/1000); | 350 | wait_event_timeout(mdc800->irq_wait, mdc800->irq_woken, |
351 | msecs_to_jiffies(msec)); | ||
351 | mdc800->irq_woken = 0; | 352 | mdc800->irq_woken = 0; |
352 | 353 | ||
353 | if (mdc800->camera_request_ready>0) | 354 | if (mdc800->camera_request_ready>0) |
@@ -743,8 +744,9 @@ static ssize_t mdc800_device_read (struct file *file, char __user *buf, size_t l | |||
743 | mutex_unlock(&mdc800->io_lock); | 744 | mutex_unlock(&mdc800->io_lock); |
744 | return len-left; | 745 | return len-left; |
745 | } | 746 | } |
746 | wait_event_timeout(mdc800->download_wait, mdc800->downloaded, | 747 | wait_event_timeout(mdc800->download_wait, |
747 | TO_DOWNLOAD_GET_READY*HZ/1000); | 748 | mdc800->downloaded, |
749 | msecs_to_jiffies(TO_DOWNLOAD_GET_READY)); | ||
748 | mdc800->downloaded = 0; | 750 | mdc800->downloaded = 0; |
749 | if (mdc800->download_urb->status != 0) | 751 | if (mdc800->download_urb->status != 0) |
750 | { | 752 | { |
@@ -867,7 +869,8 @@ static ssize_t mdc800_device_write (struct file *file, const char __user *buf, s | |||
867 | mutex_unlock(&mdc800->io_lock); | 869 | mutex_unlock(&mdc800->io_lock); |
868 | return -EIO; | 870 | return -EIO; |
869 | } | 871 | } |
870 | wait_event_timeout(mdc800->write_wait, mdc800->written, TO_WRITE_GET_READY*HZ/1000); | 872 | wait_event_timeout(mdc800->write_wait, mdc800->written, |
873 | msecs_to_jiffies(TO_WRITE_GET_READY)); | ||
871 | mdc800->written = 0; | 874 | mdc800->written = 0; |
872 | if (mdc800->state == WORKING) | 875 | if (mdc800->state == WORKING) |
873 | { | 876 | { |