summaryrefslogtreecommitdiff
path: root/rust/helpers
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2025-04-14 15:18:06 +0200
committerDanilo Krummrich <dakr@kernel.org>2025-04-19 10:54:25 +0200
commitce735e73dd59b169b877cedd0753297c81c2a091 (patch)
tree2d9bc06557bef51a97eb409a4d11a1aa27d9e6b8 /rust/helpers
parenta4c9f71e3440dc6e944fa05bb7fcb3949fe5bcd4 (diff)
rust: auxiliary: add auxiliary device / driver abstractions
Implement the basic auxiliary abstractions required to implement a driver matching an auxiliary device. The design and implementation is analogous to PCI and platform and is based on the generic device / driver abstractions. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20250414131934.28418-4-dakr@kernel.org [ Fix typos, `let _ =` => `drop()`, use `kernel::ffi`. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/helpers')
-rw-r--r--rust/helpers/auxiliary.c23
-rw-r--r--rust/helpers/helpers.c1
2 files changed, 24 insertions, 0 deletions
diff --git a/rust/helpers/auxiliary.c b/rust/helpers/auxiliary.c
new file mode 100644
index 000000000000..0db3860d774e
--- /dev/null
+++ b/rust/helpers/auxiliary.c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/auxiliary_bus.h>
+
+void rust_helper_auxiliary_set_drvdata(struct auxiliary_device *adev, void *data)
+{
+ auxiliary_set_drvdata(adev, data);
+}
+
+void *rust_helper_auxiliary_get_drvdata(struct auxiliary_device *adev)
+{
+ return auxiliary_get_drvdata(adev);
+}
+
+void rust_helper_auxiliary_device_uninit(struct auxiliary_device *adev)
+{
+ return auxiliary_device_uninit(adev);
+}
+
+void rust_helper_auxiliary_device_delete(struct auxiliary_device *adev)
+{
+ return auxiliary_device_delete(adev);
+}
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index e1c21eba9b15..6b279279cb12 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -7,6 +7,7 @@
* Sorted alphabetically.
*/
+#include "auxiliary.c"
#include "blk.c"
#include "bug.c"
#include "build_assert.c"