summaryrefslogtreecommitdiff
path: root/samples/rust/rust_driver_usb.rs
diff options
context:
space:
mode:
Diffstat (limited to 'samples/rust/rust_driver_usb.rs')
-rw-r--r--samples/rust/rust_driver_usb.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/samples/rust/rust_driver_usb.rs b/samples/rust/rust_driver_usb.rs
index 5c396f421de7..4eaad14867b2 100644
--- a/samples/rust/rust_driver_usb.rs
+++ b/samples/rust/rust_driver_usb.rs
@@ -24,12 +24,11 @@ impl usb::Driver for SampleDriver {
intf: &usb::Interface<Core>,
_id: &usb::DeviceId,
_info: &Self::IdInfo,
- ) -> Result<Pin<KBox<Self>>> {
+ ) -> impl PinInit<Self, Error> {
let dev: &device::Device<Core> = intf.as_ref();
dev_info!(dev, "Rust USB driver sample probed\n");
- let drvdata = KBox::new(Self { _intf: intf.into() }, GFP_KERNEL)?;
- Ok(drvdata.into())
+ Ok(Self { _intf: intf.into() })
}
fn disconnect(intf: &usb::Interface<Core>, _data: Pin<&Self>) {