File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ impl DriverRegistration {
7878 spi_driver. remove = self . remove ;
7979 spi_driver. shutdown = self . shutdown ;
8080
81- let this = unsafe { self . get_unchecked_mut ( ) } ;
81+ let mut this = unsafe { self . get_unchecked_mut ( ) } ;
8282 if this. registered {
8383 return Err ( Error :: EINVAL ) ;
8484 }
8585
8686 this. spi_driver = Some ( spi_driver) ;
8787
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 ( ) ) } ;
8989
9090 match res {
9191 0 => {
@@ -99,7 +99,7 @@ impl DriverRegistration {
9999
100100impl Drop for DriverRegistration {
101101 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 ) }
103103 // FIXME: No unwrap? But it's safe?
104104 }
105105}
You can’t perform that action at this time.
0 commit comments