Re: [PATCH v2 2/4] iio: magnetometer: rm3100: Use scoped_guard() in rm3100_get_samp_freq()
From: Andy Shevchenko
Date: Tue Apr 28 2026 - 10:11:27 EST
On Tue, Apr 28, 2026 at 07:46:42AM -0500, Maxwell Doose wrote:
> Replace mutex_lock() and mutex_unlock() calls in rm3100_get_samp_freq()
> with the more modern scoped_guard(). This will help modernize the
> driver and bring it up-to-date with modern available macros/functions.
...
> - mutex_lock(&data->lock);
> - ret = regmap_read(data->regmap, RM3100_REG_TMRC, &tmp);
> - mutex_unlock(&data->lock);
> - if (ret < 0)
> - return ret;
> + scoped_guard(mutex, &data->lock) {
> + ret = regmap_read(data->regmap, RM3100_REG_TMRC, &tmp);
> +
Redundant blank line as ret is defined elsewhere.
> + if (ret < 0)
> + return ret;
> + }
--
With Best Regards,
Andy Shevchenko