summaryrefslogtreecommitdiffstats
path: root/kernel/locking/mutex-debug.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:14:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:14:24 +0000
commit2a52f25b89f9c781d2c12d014354226ea2c13598 (patch)
treeb80137d1aa25be55602c98b5388327ab874bd1af /kernel/locking/mutex-debug.c
parentAdding debian version 6.9.8-1. (diff)
downloadlinux-2a52f25b89f9c781d2c12d014354226ea2c13598.tar.xz
linux-2a52f25b89f9c781d2c12d014354226ea2c13598.zip
Merging upstream version 6.9.9.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 bc8abb8549..6e6f6071cf 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