diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:14:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-07 13:14:23 +0000 |
commit | dcfb98cf8931dc6bce38eff8e1c82972e1adf484 (patch) | |
tree | 5395e7ca0effa58c164a86740b6470cbb47fe05e /kernel/locking/mutex-debug.c | |
parent | Adding upstream version 6.9.8. (diff) | |
download | linux-1263b711277bc5ddd9b568d6cfa3c8f83fe59265.tar.xz linux-1263b711277bc5ddd9b568d6cfa3c8f83fe59265.zip |
Adding upstream version 6.9.9.upstream/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.c | 12 |
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 |