summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
Diffstat (limited to 'rust')
-rw-r--r--rust/helpers/usb.c3
-rw-r--r--rust/kernel/usb.rs21
2 files changed, 17 insertions, 7 deletions
diff --git a/rust/helpers/usb.c b/rust/helpers/usb.c
index fb2aad0cbf4d..eff1cf7be3c2 100644
--- a/rust/helpers/usb.c
+++ b/rust/helpers/usb.c
@@ -2,7 +2,8 @@
#include <linux/usb.h>
-struct usb_device *rust_helper_interface_to_usbdev(struct usb_interface *intf)
+__rust_helper struct usb_device *
+rust_helper_interface_to_usbdev(struct usb_interface *intf)
{
return interface_to_usbdev(intf);
}
diff --git a/rust/kernel/usb.rs b/rust/kernel/usb.rs
index 67ce5c85c619..0e1b9a88f4f1 100644
--- a/rust/kernel/usb.rs
+++ b/rust/kernel/usb.rs
@@ -6,14 +6,23 @@
//! C header: [`include/linux/usb.h`](srctree/include/linux/usb.h)
use crate::{
- bindings, device,
- device_id::{RawDeviceId, RawDeviceIdIndex},
+ bindings,
+ device,
+ device_id::{
+ RawDeviceId,
+ RawDeviceIdIndex, //
+ },
driver,
- error::{from_result, to_result, Result},
+ error::{
+ from_result,
+ to_result, //
+ },
prelude::*,
- str::CStr,
- types::{AlwaysRefCounted, Opaque},
- ThisModule,
+ types::{
+ AlwaysRefCounted,
+ Opaque, //
+ },
+ ThisModule, //
};
use core::{
marker::PhantomData,