Skip to content

Commit 597035b

Browse files
jannauhoshinolina
authored andcommitted
*RFL fixup: kernel::driver: implement Send for Registration
required after ("rust: kernel: require `Send` for `Module` implementations") commit 323617f upstream. Fixes: 0d49178 ("*RFL import: kernel::driver") Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 8c75c34 commit 597035b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rust/kernel/driver.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ pub struct Registration<T: DriverOps> {
4545
concrete_reg: UnsafeCell<T::RegType>,
4646
}
4747

48+
// SAFETY: The only action allowed in a `Registration` instance is dropping it, so it is safe to
49+
// share references to it with multiple threads as nothing else can be done.
50+
unsafe impl<T: DriverOps> Send for Registration<T> {}
51+
4852
// SAFETY: `Registration` has no fields or methods accessible via `&Registration`, so it is safe to
4953
// share references to it with multiple threads as nothing can be done.
5054
unsafe impl<T: DriverOps> Sync for Registration<T> {}

0 commit comments

Comments
 (0)