]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: magnetometer: bmc150_magn: replace msleep with fsleep
authorNeel Bullywon <neelb2403@gmail.com>
Mon, 16 Feb 2026 01:54:53 +0000 (20:54 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 08:24:23 +0000 (08:24 +0000)
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@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/bmc150_magn.c

index a022e1805dff7e5ec6ef1ed93c268ac2dedf7a7d..4a0582d624d4ff8bb91ea3461c18d809540a10cc 100644 (file)
@@ -695,7 +695,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);