Skip to contentSkip to conversation

iio: accel: adxl355: replace usleep_range() with fsleep()

PATCH Superseded Stepan Ionichev 2 participants 4 messages May 10

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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
index 8f90c58f4..594c8ad93 100644
@@ -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
#1 lore raw
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
#2 lore raw

PATCH v2 1/1 iio: accel: adxl355: replace usleep_range() with fsleep()

In reply to Stepan Ionichev

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.

---
 drivers/iio/accel/adxl355_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/adxl355_core.c +1 -1
index 8f90c58f4..9d4421653 100644
@@ -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
#3 lore raw
Quoted 8 lines · Stepan Ionichev

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.

---

You missed a changelog here.

Signature · 2 lines
With Best Regards,
Andy Shevchenko