[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1555524925-15450-1-git-send-email-mohankumar718@gmail.com>
Date: Wed, 17 Apr 2019 21:15:25 +0300
From: Mohan Kumar <mohankumar718@...il.com>
To: ak@...klinger.de
Cc: jic23@...nel.org, knaack.h@....de, lars@...afoo.de,
pmeerw@...erw.net, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drivers: iio: proximity: This patch fix the following checkpatch warning.
As per Documentation/timers/timers-howto.txt Msleep < 20ms can sleep for
up to 20ms. so use usleep_range.
Signed-off-by: Mohan Kumar <mohankumar718@...il.com>
---
drivers/iio/proximity/mb1232.c | 2 +-
drivers/iio/proximity/srf08.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c
index 166b3e6..74f7eae 100644
--- a/drivers/iio/proximity/mb1232.c
+++ b/drivers/iio/proximity/mb1232.c
@@ -81,7 +81,7 @@ static s16 mb1232_read_distance(struct mb1232_data *data)
}
} else {
/* use simple sleep if announce irq is not connected */
- msleep(15);
+ usleep_range(15000, 20000);
}
ret = i2c_master_recv(client, (char *)&buf, sizeof(buf));
diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c
index f2bf783..605a582 100644
--- a/drivers/iio/proximity/srf08.c
+++ b/drivers/iio/proximity/srf08.c
@@ -150,7 +150,7 @@ static int srf08_read_ranging(struct srf08_data *data)
* polling for not more than 20 ms should be enough
*/
waittime = 1 + data->range_mm / 172;
- msleep(waittime);
+ usleep_range(waittime * 1000, (waittime * 1000) + 2000);
for (i = 0; i < 4; i++) {
ret = i2c_smbus_read_byte_data(data->client,
SRF08_READ_SW_REVISION);
@@ -158,7 +158,7 @@ static int srf08_read_ranging(struct srf08_data *data)
/* check if a valid version number is read */
if (ret < 255 && ret > 0)
break;
- msleep(5);
+ usleep_range(5000, 15000);
}
if (ret >= 255 || ret <= 0) {
--
2.7.4
Powered by blists - more mailing lists