Re: [PATCH v3] ACPI: pmic: Replace mutex_lock/unlock() with guard()/scoped_guard()

From: Andy Shevchenko

Date: Tue Apr 28 2026 - 04:14:52 EST


On Mon, Apr 27, 2026 at 06:11:19PM -0500, Maxwell Doose wrote:
> Replace mutex_lock() and unlock() macros with the newer guard() and
> scoped_guard() macros. This will help modernize and clean the code.
>
> In intel_soc_pmic_exec_mipi_pmic_seq_element(): While at it, remove
> now redundant "ret" variable.

...

> - } else if (d->pmic_i2c_address) {
> - if (i2c_address == d->pmic_i2c_address) {
> - ret = regmap_update_bits(intel_pmic_opregion->regmap,
> - reg_address, mask, value);
> - } else {

> + if (d->pmic_i2c_address) {
> + if (i2c_address != d->pmic_i2c_address) {

I slightly tend to make this change less invasive, id est leaving the if-else
as it was in the original code.

...

> - __func__, i2c_address, reg_address, value, mask);

> + __func__, i2c_address, reg_address, value, mask);

Stray change.

--
With Best Regards,
Andy Shevchenko