mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
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>
This commit is contained in:
parent
bf3bd1f587
commit
bfca8aba91
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user