Skip to content

Commit 51d0de7

Browse files
Danilo Krummrichgregkh
Danilo Krummrich
authored andcommitted
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: 683a63b ("rust: platform: add basic platform device / driver abstractions") Cc: stable <[email protected]> Reported-by: Alice Ryhl <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Danilo Krummrich <[email protected]> Reviewed-by: Benno Lossin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 935e1d9 commit 51d0de7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/platform.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ macro_rules! module_platform_driver {
149149
/// }
150150
/// }
151151
///```
152-
pub trait Driver {
152+
pub trait Driver: Send {
153153
/// The type holding driver private data about each device id supported by the driver.
154154
///
155155
/// TODO: Use associated_type_defaults once stabilized:

0 commit comments

Comments
 (0)