diff mbox series

[v2,05/13] iio: chemical: bme680: move to fsleep()

Message ID 20241021195316.58911-6-vassilisamir@gmail.com (mailing list archive)
State Accepted
Headers show
Series : chemical: bme680: 2nd set of cleanup | expand

Commit Message

Vasileios Amoiridis Oct. 21, 2024, 7:53 p.m. UTC
Use the new fsleep() function in the remaining driver instances.

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
 drivers/iio/chemical/bme680_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jonathan Cameron Oct. 27, 2024, 10:01 a.m. UTC | #1
On Mon, 21 Oct 2024 21:53:08 +0200
Vasileios Amoiridis <vassilisamir@gmail.com> wrote:

> Use the new fsleep() function in the remaining driver instances.
> 
> Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
Applied. Note I'm applying these having skipped patch 4, so at somepoint I may
hit a conflict with that and stop even if this code in the later patches is fine.

Jonathan

> ---
>  drivers/iio/chemical/bme680_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
> index 9002519d2c33..2ff85e29bfc1 100644
> --- a/drivers/iio/chemical/bme680_core.c
> +++ b/drivers/iio/chemical/bme680_core.c
> @@ -544,7 +544,7 @@ static int bme680_wait_for_eoc(struct bme680_data *data)
>  			   data->oversampling_humid) * 1936) + (477 * 4) +
>  			   (477 * 5) + 1000 + (data->heater_dur * 1000);
>  
> -	usleep_range(wait_eoc_us, wait_eoc_us + 100);
> +	fsleep(wait_eoc_us);
>  
>  	ret = regmap_read(data->regmap, BME680_REG_MEAS_STAT_0, &data->check);
>  	if (ret) {
> @@ -890,7 +890,7 @@ int bme680_core_probe(struct device *dev, struct regmap *regmap,
>  	if (ret < 0)
>  		return dev_err_probe(dev, ret, "Failed to reset chip\n");
>  
> -	usleep_range(BME680_STARTUP_TIME_US, BME680_STARTUP_TIME_US + 1000);
> +	fsleep(BME680_STARTUP_TIME_US);
>  
>  	ret = regmap_read(regmap, BME680_REG_CHIP_ID, &data->check);
>  	if (ret < 0)
diff mbox series

Patch

diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
index 9002519d2c33..2ff85e29bfc1 100644
--- a/drivers/iio/chemical/bme680_core.c
+++ b/drivers/iio/chemical/bme680_core.c
@@ -544,7 +544,7 @@  static int bme680_wait_for_eoc(struct bme680_data *data)
 			   data->oversampling_humid) * 1936) + (477 * 4) +
 			   (477 * 5) + 1000 + (data->heater_dur * 1000);
 
-	usleep_range(wait_eoc_us, wait_eoc_us + 100);
+	fsleep(wait_eoc_us);
 
 	ret = regmap_read(data->regmap, BME680_REG_MEAS_STAT_0, &data->check);
 	if (ret) {
@@ -890,7 +890,7 @@  int bme680_core_probe(struct device *dev, struct regmap *regmap,
 	if (ret < 0)
 		return dev_err_probe(dev, ret, "Failed to reset chip\n");
 
-	usleep_range(BME680_STARTUP_TIME_US, BME680_STARTUP_TIME_US + 1000);
+	fsleep(BME680_STARTUP_TIME_US);
 
 	ret = regmap_read(regmap, BME680_REG_CHIP_ID, &data->check);
 	if (ret < 0)