File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ impl DriverRegistration {
78
78
spi_driver. remove = self . remove ;
79
79
spi_driver. shutdown = self . shutdown ;
80
80
81
- let this = unsafe { self . get_unchecked_mut ( ) } ;
81
+ let mut this = unsafe { self . get_unchecked_mut ( ) } ;
82
82
if this. registered {
83
83
return Err ( Error :: EINVAL ) ;
84
84
}
85
85
86
86
this. spi_driver = Some ( spi_driver) ;
87
87
88
- let res = unsafe { bindings:: __spi_register_driver ( this. this_module . 0 , & mut spi_driver) } ;
88
+ let res = unsafe { bindings:: __spi_register_driver ( this. this_module . 0 , this . spi_driver . as_mut ( ) . unwrap ( ) ) } ;
89
89
90
90
match res {
91
91
0 => {
@@ -99,7 +99,7 @@ impl DriverRegistration {
99
99
100
100
impl Drop for DriverRegistration {
101
101
fn drop ( & mut self ) {
102
- unsafe { bindings:: driver_unregister ( & mut self . spi_driver . unwrap ( ) . driver ) }
102
+ unsafe { bindings:: driver_unregister ( & mut self . spi_driver . as_mut ( ) . unwrap ( ) . driver ) }
103
103
// FIXME: No unwrap? But it's safe?
104
104
}
105
105
}
You can’t perform that action at this time.
0 commit comments