Re: [PATCH 5/7] iio: pressure: dps310: use time unit macros for sleeps and timeouts

From: Andy Shevchenko

Date: Tue Nov 24 2026 - 03:58:31 EST


On Tue, Nov 24, 2026 at 12:06:47AM +0200, Rupesh Majhi wrote:
> Write the microsecond values as multiples of USEC_PER_MSEC, like the
> poll timeout next to them already uses USEC_PER_SEC. Wait the 15 ms
> after a reset with fsleep(), which allows less slack than the old
> 55 ms upper bound.

...

> rc = regmap_read_poll_timeout(data->regmap, DPS310_MEAS_CFG, ready,
> - ready & DPS310_COEF_RDY, 10000, 40000);
> + ready & DPS310_COEF_RDY,
> + 10 * USEC_PER_MSEC, 40 * USEC_PER_MSEC);

Wrap this on logical boundaries

rc = regmap_read_poll_timeout(data->regmap, DPS310_MEAS_CFG,
ready, ready & DPS310_COEF_RDY,
10 * USEC_PER_MSEC, 40 * USEC_PER_MSEC);

> if (rc)
> return rc;

...

> /* Wait for device chip access: 15ms in specification */
> - usleep_range(15000, 55000);
> + fsleep(15 * USEC_PER_MSEC);

Usually we give some margin, so putting here 20ms seems reasonable to me.
With that in mind, msleep() is fine to use explicitly as delay is so-o
long anyway.

--
With Best Regards,
Andy Shevchenko