From: Guenter Roeck Date: Wed, 13 May 2026 14:17:03 +0000 (-0700) Subject: hwmon: (ina2xx) Use scoped_guard() to acquire the subsystem lock X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=bfca8aba91dbfac0cbf84c04dc899b482c4e0b0d;p=thirdparty%2Flinux.git hwmon: (ina2xx) Use scoped_guard() to acquire the subsystem lock Use scoped_guard() instead of hwmon_lock() / hwmon_unlock() to acquire and release the hardware monitoring subsystem lock. Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 32bf4595bcb48..c4742e84b999d 100644 --- a/drivers/hwmon/ina2xx.c +++ b/drivers/hwmon/ina2xx.c @@ -875,11 +875,11 @@ static ssize_t shunt_resistor_store(struct device *dev, if (status < 0) return status; - hwmon_lock(dev); - status = ina2xx_set_shunt(data, val); - hwmon_unlock(dev); - if (status < 0) - return status; + scoped_guard(hwmon_lock, dev) { + status = ina2xx_set_shunt(data, val); + if (status < 0) + return status; + } return count; }