Skip to content

Commit 22d693e

Browse files
Danilo Krummrichgregkh
authored andcommitted
rust: usb: keep usb::Device private for now
The USB abstractions target to support USB interface drivers. While internally the abstraction has to deal with the interface's parent USB device, there shouldn't be a need for users to deal with the parent USB device directly. Functions, such as for preparing and sending USB URBs, can be implemented for the usb::Interface structure directly. Whether this internal implementation has to deal with the parent USB device can remain transparent to USB interface drivers. Hence, keep the usb::Device structure private for now, in order to avoid confusion for users and to make it less likely to accidentally expose APIs with unnecessary indirections. Should we start supporting USB device drivers, or need it for any other reason we do not foresee yet, it should be trivial to make it public again. Signed-off-by: Danilo Krummrich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f12140f commit 22d693e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/usb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ unsafe impl Sync for Interface {}
386386
///
387387
/// [`struct usb_device`]: https://www.kernel.org/doc/html/latest/driver-api/usb/usb.html#c.usb_device
388388
#[repr(transparent)]
389-
pub struct Device<Ctx: device::DeviceContext = device::Normal>(
389+
struct Device<Ctx: device::DeviceContext = device::Normal>(
390390
Opaque<bindings::usb_device>,
391391
PhantomData<Ctx>,
392392
);

0 commit comments

Comments
 (0)