Skip to content

Commit ca9f691

Browse files
committed
rust: kernel: add function to retrieve THIS_MODULE raw pointer
Signed-off-by: Fabien Parent <[email protected]>
1 parent ac06bae commit ca9f691

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rust/kernel/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ impl ThisModule {
112112
pub const unsafe fn from_ptr(ptr: *mut bindings::module) -> ThisModule {
113113
ThisModule(ptr)
114114
}
115+
116+
pub const fn as_ptr(&self) -> *mut bindings::module {
117+
self.0
118+
}
115119
}
116120

117121
#[cfg(not(any(testlib, test)))]

0 commit comments

Comments
 (0)