]> git.ipfire.org Git - thirdparty/linux.git/commit
hwmon: (pmbus_core) Use guard() for mutex protection
authorGuenter Roeck <linux@roeck-us.net>
Fri, 20 Mar 2026 14:45:55 +0000 (07:45 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Mar 2026 02:45:06 +0000 (19:45 -0700)
commitbd1c178affd7d1ca86eaf97cf797e0d15e57eb0a
treecdf0125c21fc80071e6b206e960338db10f39adf
parent1814f4d3ff358277a5b6957e7f133c2812dc80ec
hwmon: (pmbus_core) Use guard() for mutex protection

Simplify the code by using guard() and scoped_guard() instead of
mutex_lock()/mutex_unlock() sequences.

This patch changes semantics for debugfs accesses. Previously, those
used mutex_lock_interruptible() and not mutex_lock(). This change is
intentional and should have little if any impact since locks should not
be held for a significant amount of time and debugfs accesses are less
critical than sysfs accesses (which never used interruptable locks).

Reviewed-by: Sanman Pradhan <psanman@juniper.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c