Re: [PATCH v4 06/17] iio: magnetometer: ak8975: modernize polling loops with iopoll() macros
From: Andy Shevchenko
Date: Mon May 04 2026 - 07:19:11 EST
On Mon, May 04, 2026 at 11:48:18AM +0200, Joshua Crofts via B4 Relay wrote:
> The driver currently uses while loops and msleep() for polling during
> conversion waits.
>
> Replace the custom polling loops with readx_poll_timeout() and
> read_poll_timeout() macros from <linux/iopoll.h>. This reduces
> boilerplate, standardizes timeout handling and improves overall code
> readability, keeping the original timing and error behaviour. Add
> <linux/time.h> for USEC_PER_MSEC macro instead of using magic numbers.
...
> static int wait_conversion_complete_gpio(struct ak8975_data *data)
> {
> struct i2c_client *client = data->client;
> - u32 timeout_ms = AK8975_MAX_CONVERSION_TIMEOUT;
It seems logically to shuffle the order of the series and put the patch that
adds a parameter to the wait_*() custom calls before this one. It may mean
the new patch (as split from the current one by me, you can use there my
SoB/Co-developed-by though).
> int ret;
--
With Best Regards,
Andy Shevchenko