Re: [PATCH v7 1/8] iio: magnetometer: ak8975: modernize polling loops with iopoll() macros

From: Jonathan Cameron

Date: Tue May 12 2026 - 11:44:27 EST


On Mon, 11 May 2026 13:26:10 +0200
Joshua Crofts via B4 Relay <devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:

> From: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
>
> 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.
>
> Assisted-by: Gemini:3.1-Pro
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
> Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
As per discussion on the cover letter thread, lets pick up the easy stuff.

Applied this one.