]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: usb: implement Sync for Device<Bound>
authorDanilo Krummrich <dakr@kernel.org>
Mon, 25 May 2026 20:20:56 +0000 (22:20 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Wed, 27 May 2026 14:22:41 +0000 (16:22 +0200)
commit3bb1655192aeed68b761891eabdc97d9f2f7fc38
tree51fbdfac2f63653ca5f1bd028115338086038942
parent5bbcefe8db74fe07681a9ded7c13362e3eaae54a
rust: usb: implement Sync for Device<Bound>

Implement Sync for Device<Bound> in addition to Device<Normal>.

Device<Bound> uses the same underlying struct usb_device as
Device<Normal>; Bound is a zero-sized type-state marker that does not
affect thread safety.

This is needed for drivers to store &'bound usb::Device<Bound> in their
private data while remaining Send.

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Uwe Kleine-König <ukleinek@kernel.org>
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://patch.msgid.link/20260525202921.124698-10-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/usb.rs