diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs index 362ac4a56299318b3e23f69e7a7cc0efc99c7802..776b26e553dd74b22acc955219cbe9251846705f 100644 --- a/rust/kernel/platform.rs +++ b/rust/kernel/platform.rs @@ -120,6 +120,13 @@ pub struct Device { dev: ARef<device::Device> } +// SAFETY: `Device` only holds a pointer to a C device, which is safe to be used from any thread. +unsafe impl Send for Device {} + +// SAFETY: `Device` only holds a pointer to a C device, references to which are safe to be used +// from any thread. +unsafe impl Sync for Device {} + impl Device { /// Convert a raw kernel device into a `Device` ///