mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 00:56:20 +01:00
rust: platform: require Send for Driver trait implementers
The instance of Self, returned and created by Driver::probe() is
dropped in the bus' remove() callback.
Request implementers of the Driver trait to implement Send, since the
remove() callback is not guaranteed to run from the same thread as
probe().
Fixes: 683a63befc ("rust: platform: add basic platform device / driver abstractions")
Cc: stable <stable@kernel.org>
Reported-by: Alice Ryhl <aliceryhl@google.com>
Closes: https://lore.kernel.org/lkml/Z9rDxOJ2V2bPjj5i@google.com/
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20250319145350.69543-2-dakr@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
935e1d90bf
commit
51d0de7596
1 changed files with 1 additions and 1 deletions
|
|
@ -149,7 +149,7 @@ macro_rules! module_platform_driver {
|
|||
/// }
|
||||
/// }
|
||||
///```
|
||||
pub trait Driver {
|
||||
pub trait Driver: Send {
|
||||
/// The type holding driver private data about each device id supported by the driver.
|
||||
///
|
||||
/// TODO: Use associated_type_defaults once stabilized:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue