Re: [PATCH v7 2/3] iio: magnetometer: bmc150_magn: replace msleep with fsleep
From: Jonathan Cameron
Date: Fri Feb 20 2026 - 05:39:52 EST
On Sun, 15 Feb 2026 20:54:53 -0500
Neel Bullywon <neelb2403@xxxxxxxxx> wrote:
> Replace msleep(5) with fsleep(5 * USEC_PER_MSEC) to allow the kernel
> to select the most appropriate delay mechanism based on duration.
> Using USEC_PER_MSEC makes the unit conversion explicit.
>
> Signed-off-by: Neel Bullywon <neelb2403@xxxxxxxxx>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
This is independent of patch 1, so I'll pick it up now.
Please base next version of patch 1 on top of the testing branch
of iio.git (or just reorder the patches locally and only post
that one for v8!)
Applied to the testing branch of iio.git. Note I'll rebase
that on rc1 sometime next week and then it'll go out for linux-next
to pick up.
Thanks,
Jonathan
> ---
> drivers/iio/magnetometer/bmc150_magn.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
> index ff6196c86e6b..e7f8d118242b 100644
> --- a/drivers/iio/magnetometer/bmc150_magn.c
> +++ b/drivers/iio/magnetometer/bmc150_magn.c
> @@ -683,7 +683,7 @@ static int bmc150_magn_init(struct bmc150_magn_data *data)
> * 3ms power-on time according to datasheet, let's better
> * be safe than sorry and set this delay to 5ms.
> */
> - msleep(5);
> + fsleep(5 * USEC_PER_MSEC);
>
> ret = bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_SUSPEND,
> false);
#