[PATCH] iio: accel: adxl355: replace usleep_range() with fsleep()

Stepan Ionichev posted 1 patch 2 weeks, 6 days ago
There is a newer version of this series
drivers/iio/accel/adxl355_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] iio: accel: adxl355: replace usleep_range() with fsleep()
Posted by Stepan Ionichev 2 weeks, 6 days ago
The "at least 5ms" wait after software reset has no specific upper
bound. Switch to fsleep() which is the kernel helper for plain
"about N microseconds" delays.

No functional change.

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
---
 drivers/iio/accel/adxl355_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c
index 8f90c58f4..594c8ad93 100644
--- a/drivers/iio/accel/adxl355_core.c
+++ b/drivers/iio/accel/adxl355_core.c
@@ -351,7 +351,7 @@ static int adxl355_setup(struct adxl355_data *data)
 			return ret;
 
 		/* Wait at least 5ms after software reset */
-		usleep_range(5000, 10000);
+		fsleep(5000);
 
 		/* Read shadow registers for comparison */
 		ret = regmap_bulk_read(data->regmap,
-- 
2.43.0
Re: [PATCH] iio: accel: adxl355: replace usleep_range() with fsleep()
Posted by Andy Shevchenko 2 weeks, 5 days ago
On Sun, May 10, 2026 at 10:08:20AM +0500, Stepan Ionichev wrote:
> The "at least 5ms" wait after software reset has no specific upper
> bound. Switch to fsleep() which is the kernel helper for plain
> "about N microseconds" delays.
> 
> No functional change.

...

>  		/* Wait at least 5ms after software reset */
> -		usleep_range(5000, 10000);
> +		fsleep(5000);

Even better to use predefined multiplier:

		fsleep(5 * USEC_PER_MSEC);

This gives a hint on the value units without even needing / reading
the comment.

-- 
With Best Regards,
Andy Shevchenko
[PATCH v2] iio: accel: adxl355: replace usleep_range() with fsleep()
Posted by Stepan Ionichev 2 weeks, 6 days ago
The "at least 5ms" wait after software reset has no specific upper
bound. Use fsleep() with 5 * USEC_PER_MSEC to make the unit
explicit at the call site.

No functional change.

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
---
 drivers/iio/accel/adxl355_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c
index 8f90c58f4..9d4421653 100644
--- a/drivers/iio/accel/adxl355_core.c
+++ b/drivers/iio/accel/adxl355_core.c
@@ -351,7 +351,7 @@ static int adxl355_setup(struct adxl355_data *data)
 			return ret;
 
 		/* Wait at least 5ms after software reset */
-		usleep_range(5000, 10000);
+		fsleep(5 * USEC_PER_MSEC);
 
 		/* Read shadow registers for comparison */
 		ret = regmap_bulk_read(data->regmap,
-- 
2.43.0
Re: [PATCH v2] iio: accel: adxl355: replace usleep_range() with fsleep()
Posted by Andy Shevchenko 2 weeks, 5 days ago
On Sun, May 10, 2026 at 10:53:03AM +0500, Stepan Ionichev wrote:
> The "at least 5ms" wait after software reset has no specific upper
> bound. Use fsleep() with 5 * USEC_PER_MSEC to make the unit
> explicit at the call site.
> 
> No functional change.
> 
> Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
> ---

You missed a changelog here.

-- 
With Best Regards,
Andy Shevchenko