diff --git a/rust/kernel/types.rs b/rust/kernel/types.rs
index 8fad61268465a717adfaeff119cfdc107f8ccf63..2e7c9008621f5dce10437ef577ebb2ea3d9d2d7f 100644
--- a/rust/kernel/types.rs
+++ b/rust/kernel/types.rs
@@ -270,7 +270,7 @@ pub fn ffi_init(init_func: impl FnOnce(*mut T)) -> impl PinInit<Self> {
     }
 
     /// Returns a raw pointer to the opaque data.
-    pub fn get(&self) -> *mut T {
+    pub const fn get(&self) -> *mut T {
         UnsafeCell::get(&self.value).cast::<T>()
     }