OSDN Git Service

i2c: wmt: use msecs_to_jiffies for time conversions
authorNicholas Mc Guire <hofrat@osadl.org>
Sun, 1 Mar 2015 13:20:32 +0000 (08:20 -0500)
committerWolfram Sang <wsa@the-dreams.de>
Sun, 15 Mar 2015 09:18:23 +0000 (10:18 +0100)
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: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-wmt.c

index 82ea349..26e49e6 100644 (file)
@@ -177,7 +177,7 @@ static int wmt_i2c_write(struct i2c_adapter *adap, struct i2c_msg *pmsg,
 
        while (xfer_len < pmsg->len) {
                wait_result = wait_for_completion_timeout(&i2c_dev->complete,
-                                                         500 * HZ / 1000);
+                                                       msecs_to_jiffies(500));
 
                if (wait_result == 0)
                        return -ETIMEDOUT;
@@ -266,7 +266,7 @@ static int wmt_i2c_read(struct i2c_adapter *adap, struct i2c_msg *pmsg,
 
        while (xfer_len < pmsg->len) {
                wait_result = wait_for_completion_timeout(&i2c_dev->complete,
-                                                         500 * HZ / 1000);
+                                                       msecs_to_jiffies(500));
 
                if (!wait_result)
                        return -ETIMEDOUT;