diff options
author | Wedson Almeida Filho <[email protected]> | 2024-03-28 16:54:53 -0300 |
---|---|---|
committer | Miguel Ojeda <[email protected]> | 2024-04-23 00:14:05 +0200 |
commit | df70d04d56975f527b9c965322cf56e245909071 (patch) | |
tree | a66ef97ebeb64be6f862e4d0e8c8dc97aacb2235 | |
parent | 8933cf4651e02853ca679be7b2d978dfcdcc5e0c (diff) |
rust: phy: implement `Send` for `Registration`
In preparation for requiring `Send` for `Module` implementations in the
next patch.
Cc: FUJITA Tomonori <[email protected]>
Cc: Trevor Gross <[email protected]>
Cc: [email protected]
Signed-off-by: Wedson Almeida Filho <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
-rw-r--r-- | rust/kernel/net/phy.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs index 96e09c6e8530..265d0e1c1371 100644 --- a/rust/kernel/net/phy.rs +++ b/rust/kernel/net/phy.rs @@ -640,6 +640,10 @@ pub struct Registration { drivers: Pin<&'static mut [DriverVTable]>, } +// SAFETY: The only action allowed in a `Registration` instance is dropping it, which is safe to do +// from any thread because `phy_drivers_unregister` can be called from any thread context. +unsafe impl Send for Registration {} + impl Registration { /// Registers a PHY driver. pub fn register( |