Re: [PATCH] iio: pressure: bm1390: replace short msleeps with usleep_range

From: Andy Shevchenko

Date: Tue Jun 09 2026 - 02:18:25 EST


On Mon, Jun 08, 2026 at 06:41:54PM +0100, Jonathan Cameron wrote:
> On Sun, 7 Jun 2026 14:00:18 +0000
> Hungyu Lin <dennylin0707@xxxxxxxxx> wrote:
>
> > Replace msleep(1) with usleep_range(1000, 2000) for the
> > driver's short delays.
> >
> > The BM1390 datasheet specifies a 1 ms reset cancel wait time
> > (tSC1) during the power-on sequence. Use usleep_range() for
> > these short delays, as it is more appropriate than msleep()
> > and avoids unnecessarily long sleeps.
>
> Use fsleep() which has the added advantage of standardizing the
> 'slack' so we don't have to thing about the values chosen

While true, msleep(1) is kinda idiomatic, we don't need to hunt subtle timing
issues in case of switching to stricter fsleep(), which will most likely choose
usleep_range() beneath. TL;DR: I do not see a value in this change.

--
With Best Regards,
Andy Shevchenko