From: Dave Airlie <[email protected]> The nouveau C driver does ktime_to_ns(ktime_get()) to program the cpu ns into some hw/fw, so allow this method for rust drivers.
This is needed for following nova patch. Reviewed-by: FUJITA Tomonori <[email protected]> Reviewed-by: Alexandre Courbot <[email protected]> Signed-off-by: Dave Airlie <[email protected]> --- rust/kernel/time.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/kernel/time.rs b/rust/kernel/time.rs index b6a2aab12a50..4409291f3ffa 100644 --- a/rust/kernel/time.rs +++ b/rust/kernel/time.rs @@ -215,8 +215,9 @@ pub fn elapsed(&self) -> Delta { Self::now() - *self } + /// Return the raw nanoseconds values since the epoch of clock `C`. #[inline] - pub(crate) fn as_nanos(&self) -> i64 { + pub fn as_nanos(&self) -> i64 { self.inner } -- 2.56.0
