rust: net: use core::ffi::CStr method names
Prepare for `core::ffi::CStr` taking the place of `kernel::str::CStr` by avoid methods that only exist on the latter. Link: https://github.com/Rust-for-Linux/linux/issues/1075 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
committed by
Miguel Ojeda
parent
e49c43ef82
commit
182d95571f
@@ -497,7 +497,7 @@ unsafe impl Sync for DriverVTable {}
|
||||
pub const fn create_phy_driver<T: Driver>() -> DriverVTable {
|
||||
// INVARIANT: All the fields of `struct phy_driver` are initialized properly.
|
||||
DriverVTable(Opaque::new(bindings::phy_driver {
|
||||
name: T::NAME.as_char_ptr().cast_mut(),
|
||||
name: crate::str::as_char_ptr_in_const_context(T::NAME).cast_mut(),
|
||||
flags: T::FLAGS,
|
||||
phy_id: T::PHY_DEVICE_ID.id(),
|
||||
phy_id_mask: T::PHY_DEVICE_ID.mask_as_int(),
|
||||
|
||||
Reference in New Issue
Block a user