diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs index c6823decbb2e..e7a2024b88d5 100644 --- a/rust/kernel/device.rs +++ b/rust/kernel/device.rs @@ -185,7 +185,7 @@ unsafe fn printk(&self, klevel: &[u8], msg: fmt::Arguments<'_>) { /// Checks if property is present or not. 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 _) } + unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_char_ptr()) } } }