From: Guenter Roeck Date: Wed, 13 May 2026 14:22:02 +0000 (-0700) Subject: hwmon: (adt7411) Use scoped_guard() to acquire the subsystem lock X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=692c9f26424be53b871f9ef5eca8085824137066;p=thirdparty%2Flinux.git 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 --- diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index 5dce2a7017258..598f316475446 100644 --- a/drivers/hwmon/adt7411.c +++ b/drivers/hwmon/adt7411.c @@ -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; }