summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2026-05-13 07:17:03 -0700
committerGuenter Roeck <linux@roeck-us.net>2026-06-09 08:23:00 -0700
commitbfca8aba91dbfac0cbf84c04dc899b482c4e0b0d (patch)
tree6e74137c279e5b510e8538754ef5771b4ee563f1
parentbf3bd1f587f5a56ce60173324db27e5e50aa56b0 (diff)
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 <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/ina2xx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index 32bf4595bcb4..c4742e84b999 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;
}