提交 424c5d3a 编写于 作者: 李弘宇's avatar 李弘宇

rust: fix the compile bug

openEuler inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5THDX
CVE: NA

--------------------------------

The current kernel with CONFIG_RUST can not compile.
Signed-off-by: 李弘宇's avatarLi Hongyu <543306408@qq.com>
上级 6df59de0
...@@ -133,7 +133,7 @@ unsafe extern "C" fn probe_callback<T: Driver>( ...@@ -133,7 +133,7 @@ unsafe extern "C" fn probe_callback<T: Driver>(
} }
} }
unsafe extern "C" fn remove_callback<T: Driver>(adev: *mut bindings::amba_device) -> i32 { unsafe extern "C" fn remove_callback<T: Driver>(adev: *mut bindings::amba_device) {
// SAFETY: `adev` is valid by the contract with the C code. // SAFETY: `adev` is valid by the contract with the C code.
let ptr = unsafe { bindings::amba_get_drvdata(adev) }; let ptr = unsafe { bindings::amba_get_drvdata(adev) };
// SAFETY: The value returned by `amba_get_drvdata` was stored by a previous call to // SAFETY: The value returned by `amba_get_drvdata` was stored by a previous call to
...@@ -142,7 +142,6 @@ unsafe extern "C" fn remove_callback<T: Driver>(adev: *mut bindings::amba_device ...@@ -142,7 +142,6 @@ unsafe extern "C" fn remove_callback<T: Driver>(adev: *mut bindings::amba_device
let data = unsafe { T::Data::from_pointer(ptr) }; let data = unsafe { T::Data::from_pointer(ptr) };
T::remove(&data); T::remove(&data);
<T::Data as driver::DeviceRemoval>::device_remove(&data); <T::Data as driver::DeviceRemoval>::device_remove(&data);
0
} }
/// An Amba device. /// An Amba device.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册