From bfca8aba91dbfac0cbf84c04dc899b482c4e0b0d Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 13 May 2026 07:17:03 -0700 Subject: [PATCH] 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 --- drivers/hwmon/ina2xx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.47.3