diff options
author | Aniroop Mathur <a.mathur@samsung.com> | 2016-11-26 09:17:26 +0530 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-12-03 08:58:40 +0000 |
commit | 071cf2494361fd856f1a6781f9c554da67e35e3c (patch) | |
tree | 173b553342e17952c5c58dbefe779537608ef07f /drivers/staging/iio/meter | |
parent | 160d95870c8a44480fad49dc09fa4f0cc04e7098 (diff) | |
download | linux-071cf2494361fd856f1a6781f9c554da67e35e3c.tar.gz linux-071cf2494361fd856f1a6781f9c554da67e35e3c.tar.bz2 linux-071cf2494361fd856f1a6781f9c554da67e35e3c.zip |
IIO: Change msleep to usleep_range for small msecs
msleep(1~20) may not do what the caller intends, and will often sleep longer.
(~20 ms actual sleep for any value given in the 1~20ms range)
This is not the desired behaviour for many cases like device resume time,
device suspend time, device enable time, data reading time, etc.
Thus, change msleep to usleep_range for precise wakeups.
Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/meter')
-rw-r--r-- | drivers/staging/iio/meter/ade7753.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7753.h | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7754.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7754.h | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758.h | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7758_core.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7759.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7759.h | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7854.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/meter/ade7854.h | 2 |
10 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index 4b5f05fdadcd..671dc9971610 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c @@ -377,7 +377,7 @@ static int ade7753_initial_setup(struct iio_dev *indio_dev) } ade7753_reset(dev); - msleep(ADE7753_STARTUP_DELAY); + usleep_range(ADE7753_STARTUP_DELAY, ADE7753_STARTUP_DELAY + 100); err_ret: return ret; diff --git a/drivers/staging/iio/meter/ade7753.h b/drivers/staging/iio/meter/ade7753.h index a9d93cc1c414..bfe749156bce 100644 --- a/drivers/staging/iio/meter/ade7753.h +++ b/drivers/staging/iio/meter/ade7753.h @@ -49,7 +49,7 @@ #define ADE7753_MAX_TX 4 #define ADE7753_MAX_RX 4 -#define ADE7753_STARTUP_DELAY 1 +#define ADE7753_STARTUP_DELAY 1000 #define ADE7753_SPI_SLOW (u32)(300 * 1000) #define ADE7753_SPI_BURST (u32)(1000 * 1000) diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index 17309591ca57..024463a11c47 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c @@ -389,7 +389,7 @@ static int ade7754_initial_setup(struct iio_dev *indio_dev) } ade7754_reset(dev); - msleep(ADE7754_STARTUP_DELAY); + usleep_range(ADE7754_STARTUP_DELAY, ADE7754_STARTUP_DELAY + 100); err_ret: return ret; diff --git a/drivers/staging/iio/meter/ade7754.h b/drivers/staging/iio/meter/ade7754.h index e42ffc387a14..28f71c2cde0c 100644 --- a/drivers/staging/iio/meter/ade7754.h +++ b/drivers/staging/iio/meter/ade7754.h @@ -67,7 +67,7 @@ #define ADE7754_MAX_TX 4 #define ADE7754_MAX_RX 4 -#define ADE7754_STARTUP_DELAY 1 +#define ADE7754_STARTUP_DELAY 1000 #define ADE7754_SPI_SLOW (u32)(300 * 1000) #define ADE7754_SPI_BURST (u32)(1000 * 1000) diff --git a/drivers/staging/iio/meter/ade7758.h b/drivers/staging/iio/meter/ade7758.h index 1d04ec9524c8..6ae78d8aa24f 100644 --- a/drivers/staging/iio/meter/ade7758.h +++ b/drivers/staging/iio/meter/ade7758.h @@ -89,7 +89,7 @@ #define ADE7758_MAX_TX 8 #define ADE7758_MAX_RX 4 -#define ADE7758_STARTUP_DELAY 1 +#define ADE7758_STARTUP_DELAY 1000 #define AD7758_NUM_WAVSEL 5 #define AD7758_NUM_PHSEL 3 diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c index 3af8f77b8e41..99c89e606c8d 100644 --- a/drivers/staging/iio/meter/ade7758_core.c +++ b/drivers/staging/iio/meter/ade7758_core.c @@ -459,7 +459,7 @@ static int ade7758_initial_setup(struct iio_dev *indio_dev) } ade7758_reset(dev); - msleep(ADE7758_STARTUP_DELAY); + usleep_range(ADE7758_STARTUP_DELAY, ADE7758_STARTUP_DELAY + 100); err_ret: return ret; diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index 80144d40d9ca..944ee3401029 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c @@ -338,7 +338,7 @@ static int ade7759_initial_setup(struct iio_dev *indio_dev) } ade7759_reset(dev); - msleep(ADE7759_STARTUP_DELAY); + usleep_range(ADE7759_STARTUP_DELAY, ADE7759_STARTUP_DELAY + 100); err_ret: return ret; diff --git a/drivers/staging/iio/meter/ade7759.h b/drivers/staging/iio/meter/ade7759.h index f9ff1f8e7372..f0716d2fdf8e 100644 --- a/drivers/staging/iio/meter/ade7759.h +++ b/drivers/staging/iio/meter/ade7759.h @@ -30,7 +30,7 @@ #define ADE7759_MAX_TX 6 #define ADE7759_MAX_RX 6 -#define ADE7759_STARTUP_DELAY 1 +#define ADE7759_STARTUP_DELAY 1000 #define ADE7759_SPI_SLOW (u32)(300 * 1000) #define ADE7759_SPI_BURST (u32)(1000 * 1000) diff --git a/drivers/staging/iio/meter/ade7854.c b/drivers/staging/iio/meter/ade7854.c index 24edbc39ab4e..e8007f0c5186 100644 --- a/drivers/staging/iio/meter/ade7854.c +++ b/drivers/staging/iio/meter/ade7854.c @@ -444,7 +444,7 @@ static int ade7854_initial_setup(struct iio_dev *indio_dev) } ade7854_reset(dev); - msleep(ADE7854_STARTUP_DELAY); + usleep_range(ADE7854_STARTUP_DELAY, ADE7854_STARTUP_DELAY + 100); err_ret: return ret; diff --git a/drivers/staging/iio/meter/ade7854.h b/drivers/staging/iio/meter/ade7854.h index 52f4195cf6f4..dbd97def9cd8 100644 --- a/drivers/staging/iio/meter/ade7854.h +++ b/drivers/staging/iio/meter/ade7854.h @@ -136,7 +136,7 @@ #define ADE7854_MAX_TX 7 #define ADE7854_MAX_RX 7 -#define ADE7854_STARTUP_DELAY 1 +#define ADE7854_STARTUP_DELAY 1000 #define ADE7854_SPI_SLOW (u32)(300 * 1000) #define ADE7854_SPI_BURST (u32)(1000 * 1000) |