diff options
| author | Maxime Ripard <[email protected]> | 2024-07-04 15:19:33 +0200 |
|---|---|---|
| committer | Maxime Ripard <[email protected]> | 2024-07-04 15:19:33 +0200 |
| commit | afeea2758b4f1210361ce2a91d8fa3e7df606ad2 (patch) | |
| tree | 969164f4e52fac6d4ec7d275540e702375e80950 /kernel/locking/mutex-debug.c | |
| parent | 539d33b5783804f22a62bd62ff463dfd1cef4265 (diff) | |
| parent | 896868eded124059023be0af92d68cdaf9b4de70 (diff) | |
Merge drm-misc-next-2024-07-04 into drm-misc-next-fixes
Let's start the drm-misc-next-fixes cycle.
Signed-off-by: Maxime Ripard <[email protected]>
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 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 |