summaryrefslogtreecommitdiff
path: root/samples/rust/rust_pci_driver/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/rust/rust_pci_driver/mod.rs')
-rw-r--r--samples/rust/rust_pci_driver/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/samples/rust/rust_pci_driver/mod.rs b/samples/rust/rust_pci_driver/mod.rs
index e4e848d7c59d..9685bd6d2cde 100644
--- a/samples/rust/rust_pci_driver/mod.rs
+++ b/samples/rust/rust_pci_driver/mod.rs
@@ -14,14 +14,16 @@ module! {
license: "GPL",
}
+#[pin_data]
struct Module {
+ #[pin]
_reg: kernel::driver::Registration<pci::Adapter<driver::Driver>>,
}
-impl kernel::Module for Module {
- fn init(name: &'static CStr, module: &'static ThisModule) -> Result<Self> {
- Ok(Module {
- _reg: kernel::driver::Registration::new(name, module)?,
+impl kernel::InPlaceModule for Module {
+ fn init(name: &'static CStr, module: &'static ThisModule) -> impl PinInit<Self, Error> {
+ try_pin_init!(Module {
+ _reg <- kernel::driver::Registration::new(name, module),
})
}
}