Re: [PATCH v5 06/18] iio: magnetometer: ak8975: pass conversion timeouts as arguments
From: Andy Shevchenko
Date: Wed May 06 2026 - 02:36:09 EST
On Tue, May 05, 2026 at 01:46:02PM +0200, Joshua Crofts via B4 Relay wrote:
> Refactor wait_conversion_complete*_() helper function to accept poll
functions
> and timeout values directly as parameters. This improves the
> readability of the code and does not rely on hardcoded macros.
>
> Besides that, fix the home grown and obviously wrong in some cases the
> jiffy-based timeout.
...
> static int ak8975_start_read_axis(struct ak8975_data *data,
> const struct i2c_client *client)
> {
> - /* Set up the device for taking a sample. */
> - int ret = ak8975_set_mode(data, MODE_ONCE);
> + int ret;
>
> + /* Set up the device for taking a sample. */
> + ret = ak8975_set_mode(data, MODE_ONCE);
But this piece does not belong to the main scope of the patch.
> if (ret < 0) {
> dev_err(&client->dev, "Error in setting operating mode\n");
> return ret;
--
With Best Regards,
Andy Shevchenko