summaryrefslogtreecommitdiff
path: root/rust/helpers/workqueue.c
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2024-09-30 11:28:07 +0200
committerJerome Brunet <jbrunet@baylibre.com>2024-09-30 11:28:07 +0200
commit3fd6c59042dbba50391e30862beac979491145fe (patch)
tree63d729254efdf6446d4d4a05e7a8a0dd803eedec /rust/helpers/workqueue.c
parent1d7ec62374bf049349c47f07f0b95a6524bb1b98 (diff)
parent9852d85ec9d492ebef56dc5f229416c925758edc (diff)
Merge tag 'v6.12-rc1' into clk-meson-next
Linux 6.12-rc1
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;
+}