summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLee Jones <lee@kernel.org>2024-04-12 09:46:50 +0100
committerLee Jones <lee@kernel.org>2024-04-12 09:46:50 +0100
commit66f7d2ceae4e49194bfe360e14a848fde420e2fc (patch)
tree4d1cc12266a7af17547b27f983472adb969e7f45 /kernel
parentab2ab9e69ef9734b875ce6d43fe3f9f90135daae (diff)
parentc382e2e3eccb6b7ca8c7aff5092c1668428e7de6 (diff)
Merge branches 'ib-leds-mips-sound-6.10' and 'ib-leds-locking-6.10' into ibs-for-leds-merged
Diffstat (limited to 'kernel')
-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