Alvin Sun
unread,May 21, 2026, 3:53:00 AM (4 days ago) May 21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich, Luis Chamberlain, Petr Pavlu, Daniel Gomez, Sami Tolvanen, Aaron Tomlin, Greg Kroah-Hartman, Rafael J. Wysocki, David Airlie, Simona Vetter, Daniel Almeida, Arnd Bergmann, Brendan Higgins, David Gow, Rae Moar, Breno Leitao, Jens Axboe, rust-fo...@vger.kernel.org, linux-...@vger.kernel.org, drive...@lists.linux.dev, dri-...@lists.freedesktop.org, nova...@lists.linux.dev, linux-k...@vger.kernel.org, kuni...@googlegroups.com, linux...@vger.kernel.org, Alvin Sun
Set the miscdevice fops owner field from the driver module pointer
via `<T::ThisModule as ModuleMetadata>::THIS_MODULE`, instead of
defaulting to null.
Signed-off-by: Alvin Sun <
alvi...@linux.dev>
---
rust/kernel/miscdevice.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index 83ce50def5ac9..16837c46bca49 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -30,6 +30,7 @@
ForeignOwnable,
Opaque, //
},
+ ModuleMetadata, //
};
use core::marker::PhantomData;
@@ -430,6 +431,7 @@ impl<T: MiscDevice> MiscdeviceVTable<T> {
} else {
None
},
+ owner: <T::ThisModule as ModuleMetadata>::THIS_MODULE.as_ptr(),
..pin_init::zeroed()
};
--
2.43.0