hwmon: (adt7411) 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>
This commit is contained in:
Guenter Roeck committed 2026-06-09 08:23:00 -07:00
1 parent bfca8aba91
commit 692c9f2642
1 file changed
+5 -5
+5 -5
View File
@@ -169,11 +169,11 @@ static ssize_t adt7411_set_bit(struct device *dev,
if (ret || flag > 1)
return -EINVAL;
hwmon_lock(dev);
ret = adt7411_modify_bit(client, s_attr2->index, s_attr2->nr, flag);
/* force update */
data->next_update = jiffies;
hwmon_unlock(dev);
scoped_guard(hwmon_lock, dev) {
ret = adt7411_modify_bit(client, s_attr2->index, s_attr2->nr, flag);
/* force update */
data->next_update = jiffies;
}
return ret < 0 ? ret : count;
}