summaryrefslogtreecommitdiff
path: root/rust/helpers/workqueue.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-09-30 10:50:54 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2024-09-30 10:50:54 +0200
commit2dd0ef5d951e9b565ddb324fe26c531b6a40bf82 (patch)
treeb24f5029eaa4cea229163c14549f571499c36fde /rust/helpers/workqueue.c
parent15499749fbb864cc0737bc8ecaf0e28a6b6d62dd (diff)
parent9852d85ec9d492ebef56dc5f229416c925758edc (diff)
Merge drm/drm-next into drm-misc-next
Get drm-misc-next to up v6.12-rc1. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'rust/helpers/workqueue.c')
-rw-r--r--rust/helpers/workqueue.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/rust/helpers/workqueue.c b/rust/helpers/workqueue.c
new file mode 100644
index 000000000000..f59427acc323
--- /dev/null
+++ b/rust/helpers/workqueue.c
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/workqueue.h>
+
+void rust_helper_init_work_with_key(struct work_struct *work, work_func_t func,
+ bool onstack, const char *name,
+ struct lock_class_key *key)
+{
+ __init_work(work, onstack);
+ work->data = (atomic_long_t)WORK_DATA_INIT();
+ lockdep_init_map(&work->lockdep_map, name, key, 0);
+ INIT_LIST_HEAD(&work->entry);
+ work->func = func;
+}