iio: accel: adxl355: replace usleep_range() with fsleep()
PATCH 1/1 iio: accel: adxl355: replace usleep_range() with fsleep()
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.
--- drivers/iio/accel/adxl355_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl355_core.c +1 -1
@@ -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,
Signature · 1 line
2.43.0
Quoted 5 lines · Stepan Ionichev
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.
...
drivers/iio/accel/adxl355_core.c static int adxl355_setup(struct adxl355_data *data) · line 354
Quoted 3 lines
drivers/iio/accel/adxl355_core.c +1
-1/* 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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH v2 1/1 iio: accel: adxl355: replace usleep_range() with fsleep()
In reply to Stepan IonichevThe "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.
--- drivers/iio/accel/adxl355_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl355_core.c +1 -1
@@ -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,
Signature · 1 line
2.43.0
Quoted 8 lines · Stepan Ionichev
The "at least 5ms" wait after software reset has no specific upper bound. Use
fsleep()with 5 *USEC_PER_MSECto make the unit explicit at the call site.No functional change.
Signed-off-by Stepan Ionichev <[email protected]>---
You missed a changelog here.
Signature · 2 lines
With Best Regards, Andy Shevchenko