Re: [PATCH 3/4] iio: magnetometer: rm3100: Use guard(mutex)() in rm3100_set_samp_freq()

From: Andy Shevchenko

Date: Tue Apr 28 2026 - 04:39:17 EST


On Mon, Apr 27, 2026 at 09:43:38PM -0500, Maxwell Doose wrote:
> Replace mutex_lock() and mutex_unlock() calls in rm3100_set_samp_freq
> with the more modern guard(mutex)(). This will help modernize the
> driver and bring it up-to-date with modern available macros/functions.
>
> While at it, remove unlock_return goto and use direct returns instead.

...

> - mutex_lock(&data->lock);
> + guard(mutex)(&data->lock);

+ Blank line now.

> /* All cycle count registers use the same value. */
> ret = regmap_read(regmap, RM3100_REG_CC_X, &cycle_count);
> if (ret < 0)
> - goto unlock_return;
> + return ret;

--
With Best Regards,
Andy Shevchenko