[PATCH] iio: magnetometer: ak8975: replace usleep_range() with fsleep()

Stepan Ionichev posted 1 patch 1 month ago
drivers/iio/magnetometer/ak8975.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] iio: magnetometer: ak8975: replace usleep_range() with fsleep()
Posted by Stepan Ionichev 1 month ago
The "minimum 500us here" wait after power-up has no specific upper
bound. fsleep(500) expands to the same usleep_range(500, 1000)
internally.

No functional change.

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
---
 drivers/iio/magnetometer/ak8975.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
index b648b0afa..a88b19fc1 100644
--- a/drivers/iio/magnetometer/ak8975.c
+++ b/drivers/iio/magnetometer/ak8975.c
@@ -456,7 +456,7 @@ static int ak8975_power_on(const struct ak8975_data *data)
 	 * and the minimum wait time before mode setting is 100us, in
 	 * total 300us. Add some margin and say minimum 500us here.
 	 */
-	usleep_range(500, 1000);
+	fsleep(500);
 	return 0;
 }
 
-- 
2.43.0
Re: [PATCH] iio: magnetometer: ak8975: replace usleep_range() with fsleep()
Posted by Stepan Ionichev 1 month ago
Sorry, missed your earlier post. Please drop mine; yours has priority.

Stepan
Re: [PATCH] iio: magnetometer: ak8975: replace usleep_range() with fsleep()
Posted by Joshua Crofts 1 month ago
On Sun, 10 May 2026 at 16:35, Stepan Ionichev <sozdayvek@gmail.com> wrote:
>
> The "minimum 500us here" wait after power-up has no specific upper
> bound. fsleep(500) expands to the same usleep_range(500, 1000)
> internally.
>
> No functional change.
>
> Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
> ---
>  drivers/iio/magnetometer/ak8975.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index b648b0afa..a88b19fc1 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -456,7 +456,7 @@ static int ak8975_power_on(const struct ak8975_data *data)
>          * and the minimum wait time before mode setting is 100us, in
>          * total 300us. Add some margin and say minimum 500us here.
>          */
> -       usleep_range(500, 1000);
> +       fsleep(500);
>         return 0;
>  }
>
> --
> 2.43.0
>
>

I've beaten you to it unfortunately...
https://lore.kernel.org/all/20260506173946.2b1907d7@jic23-huawei/

-- 
Kind regards

CJD