Skip to content

Commit e34aaff

Browse files
committed
*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 4a6c0c7 commit e34aaff

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
@@ -52,6 +52,10 @@ pub struct Registration<T: DriverOps> {
5252
concrete_reg: UnsafeCell<T::RegType>,
5353
}
5454

55+
// SAFETY: The only action allowed in a `Registration` instance is dropping it, so it is safe to
56+
// share references to it with multiple threads as nothing else can be done.
57+
unsafe impl<T: DriverOps> Send for Registration<T> {}
58+
5559
// SAFETY: `Registration` has no fields or methods accessible via `&Registration`, so it is safe to
5660
// share references to it with multiple threads as nothing can be done.
5761
unsafe impl<T: DriverOps> Sync for Registration<T> {}

0 commit comments

Comments
 (0)