mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
iio: magnetometer: ak8975: replace usleep_range() with fsleep()
Replace usleep_range() calls with fsleep(), passing the minimum value required by the sensor for hardware delays. fsleep() automatically selects the optimal sleep mechanism, simplifying driver code and time management. Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
9d59def370
commit
1fcd1fef65
|
|
@ -461,7 +461,8 @@ 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;
|
||||
}
|
||||
|
||||
|
|
@ -551,7 +552,7 @@ static int ak8975_set_mode(struct ak8975_data *data, enum ak_ctrl_mode mode)
|
|||
|
||||
data->cntl_cache = regval;
|
||||
/* After mode change wait at least 100us */
|
||||
usleep_range(100, 500);
|
||||
fsleep(100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user