@@ -17,7 +17,7 @@ use crate::bindings;
1717use crate :: c_types;
1818use crate :: error:: { Error , Result } ;
1919use crate :: file_operations;
20- use crate :: types :: CStr ;
20+ use crate :: str :: CStr ;
2121
2222/// Character device.
2323///
@@ -87,7 +87,7 @@ struct RegistrationInner<const N: usize> {
8787///
8888/// May contain up to a fixed number (`N`) of devices. Must be pinned.
8989pub struct Registration < const N : usize > {
90- name : CStr < ' static > ,
90+ name : & ' static CStr ,
9191 minors_start : u16 ,
9292 this_module : & ' static crate :: ThisModule ,
9393 inner : Option < RegistrationInner < N > > ,
@@ -104,7 +104,7 @@ impl<const N: usize> Registration<{ N }> {
104104 /// are going to pin the registration right away, call
105105 /// [`Self::new_pinned()`] instead.
106106 pub fn new (
107- name : CStr < ' static > ,
107+ name : & ' static CStr ,
108108 minors_start : u16 ,
109109 this_module : & ' static crate :: ThisModule ,
110110 ) -> Self {
@@ -120,7 +120,7 @@ impl<const N: usize> Registration<{ N }> {
120120 ///
121121 /// This does *not* register the device: see [`Self::register()`].
122122 pub fn new_pinned (
123- name : CStr < ' static > ,
123+ name : & ' static CStr ,
124124 minors_start : u16 ,
125125 this_module : & ' static crate :: ThisModule ,
126126 ) -> Result < Pin < Box < Self > > > {
@@ -146,7 +146,7 @@ impl<const N: usize> Registration<{ N }> {
146146 & mut dev,
147147 this. minors_start . into ( ) ,
148148 N . try_into ( ) ?,
149- this. name . as_ptr ( ) as * const c_types :: c_char ,
149+ this. name . as_char_ptr ( ) ,
150150 )
151151 } ;
152152 if res != 0 {
0 commit comments