lkml.org 
[lkml]   [2026]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 06/17] iio: magnetometer: ak8975: modernize polling loops with iopoll() macros
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



\
 
 \ /
  Last update: 2026-05-04 13:19    [W:0.205 / U:10.094 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog