mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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:
parent
bfca8aba91
commit
692c9f2642
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user