mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 09:17:30 -04: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user