diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs index eadc6160a4be..c6823decbb2e 100644 --- a/rust/kernel/device.rs +++ b/rust/kernel/device.rs @@ -6,7 +6,7 @@ use crate::{ bindings, - str::CString, + str::CStr, types::{ARef, Opaque}, }; use core::{fmt, ptr}; @@ -183,8 +183,8 @@ unsafe fn printk(&self, klevel: &[u8], msg: fmt::Arguments<'_>) { } /// Checks if property is present or not. - pub fn property_present(&self, name: &CString) -> bool { - // SAFETY: By the invariant of `CString`, `name` is null-terminated. + pub fn property_present(&self, name: &CStr) -> bool { + // SAFETY: By the invariant of `CStr`, `name` is null-terminated. unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_ptr() as *const _) } } }