summaryrefslogtreecommitdiff
path: root/rust/helpers.c
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@redhat.com>2024-06-18 17:48:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-18 18:45:06 +0200
commita674fefd17324fc467f043568e738b80ca22f2b4 (patch)
treeee984f25a8a4b6d1a7742b8d51e7ad25c61964db /rust/helpers.c
parentfca3eff7d36bcd1a51d2c256ccebbe3617d4fe3a (diff)
rust: add abstraction for struct device
Add an (always) reference-counted abstraction for a generic C `struct device`. This abstraction encapsulates existing `struct device` instances and manages its reference count. Subsystems may use this abstraction as a base to abstract subsystem specific device instances based on a generic `struct device`, such as `struct pci_dev`. Co-developed-by: Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Link: https://lore.kernel.org/r/20240618154841.6716-2-dakr@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/helpers.c')
-rw-r--r--rust/helpers.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/helpers.c b/rust/helpers.c
index 2c37a0f5d7a8..0e02b2c64c72 100644
--- a/rust/helpers.c
+++ b/rust/helpers.c
@@ -23,6 +23,7 @@
#include <kunit/test-bug.h>
#include <linux/bug.h>
#include <linux/build_bug.h>
+#include <linux/device.h>
#include <linux/err.h>
#include <linux/errname.h>
#include <linux/mutex.h>