[PATCH 8/8] samples: rust: rust_misc_device: implement `ThisModule` for `RustMiscDevice`

From: Alvin Sun

Date: Tue May 19 2026 - 02:37:06 EST


Set `ThisModule = RustMiscDeviceModule` to provide the correct module
pointer for file operations ownership.

Signed-off-by: Alvin Sun <alvin.sun@xxxxxxxxx>
---
samples/rust/rust_misc_device.rs | 1 +
1 file changed, 1 insertion(+)

diff --git a/samples/rust/rust_misc_device.rs b/samples/rust/rust_misc_device.rs
index 41e26c825060b..a4b012a35b5ec 100644
--- a/samples/rust/rust_misc_device.rs
+++ b/samples/rust/rust_misc_device.rs
@@ -176,6 +176,7 @@ struct RustMiscDevice {
#[vtable]
impl MiscDevice for RustMiscDevice {
type Ptr = Pin<KBox<Self>>;
+ type ThisModule = RustMiscDeviceModule;

fn open(_file: &File, misc: &MiscDeviceRegistration<Self>) -> Result<Pin<KBox<Self>>> {
let dev = ARef::from(misc.device());

--
2.43.0