Skip to content

Commit 935e1d9

Browse files
Danilo Krummrichgregkh
authored andcommitted
rust: pci: 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: 1bd8b6b ("rust: pci: add basic PCI 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 455943a commit 935e1d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/pci.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ macro_rules! pci_device_table {
222222
///```
223223
/// Drivers must implement this trait in order to get a PCI driver registered. Please refer to the
224224
/// `Adapter` documentation for an example.
225-
pub trait Driver {
225+
pub trait Driver: Send {
226226
/// The type holding information about each device id supported by the driver.
227227
///
228228
/// TODO: Use associated_type_defaults once stabilized:

0 commit comments

Comments
 (0)