aboutsummaryrefslogtreecommitdiff
path: root/kernel/locking/mutex-debug.c
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2024-07-04 16:00:24 +0200
committerPeter Zijlstra <[email protected]>2024-07-04 16:00:24 +0200
commit0c8ea05e9b3d8e5287e2a968f2a2e744dfd31b99 (patch)
treeba0443b74f063471c5d81d85e795e04e7e1dc79c /kernel/locking/mutex-debug.c
parent0ca4da2412da05fb9dd0b5d90dcc8026219f0f29 (diff)
parent34b3fc558b537bdf99644dcde539e151716f6331 (diff)
Merge branch 'tip/x86/cpu'
The Lunarlake patches rely on the new VFM stuff. Signed-off-by: Peter Zijlstra <[email protected]>
Diffstat (limited to 'kernel/locking/mutex-debug.c')
-rw-r--r--kernel/locking/mutex-debug.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/locking/mutex-debug.c b/kernel/locking/mutex-debug.c
index bc8abb8549d2..6e6f6071cfa2 100644
--- a/kernel/locking/mutex-debug.c
+++ b/kernel/locking/mutex-debug.c
@@ -12,6 +12,7 @@
*/
#include <linux/mutex.h>
#include <linux/delay.h>
+#include <linux/device.h>
#include <linux/export.h>
#include <linux/poison.h>
#include <linux/sched.h>
@@ -89,6 +90,17 @@ void debug_mutex_init(struct mutex *lock, const char *name,
lock->magic = lock;
}
+static void devm_mutex_release(void *res)
+{
+ mutex_destroy(res);
+}
+
+int __devm_mutex_init(struct device *dev, struct mutex *lock)
+{
+ return devm_add_action_or_reset(dev, devm_mutex_release, lock);
+}
+EXPORT_SYMBOL_GPL(__devm_mutex_init);
+
/***
* mutex_destroy - mark a mutex unusable
* @lock: the mutex to be destroyed