We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15c3522 commit 611788aCopy full SHA for 611788a
rust/kernel/i2c.rs
@@ -6,7 +6,7 @@
6
7
use crate::{
8
bindings,
9
- device::RawDevice,
+ device::{Device, RawDevice},
10
driver::{self, RawDeviceId},
11
error::{from_result, to_result, Result},
12
of,
@@ -213,6 +213,13 @@ impl Client {
213
pub fn raw_client(&self) -> *mut bindings::i2c_client {
214
self.ptr
215
}
216
+
217
+ /// Returns the I2C client [`Device`] structure
218
+ pub fn device(&self) -> Device {
219
+ Device {
220
+ ptr: self.raw_device(),
221
+ }
222
223
224
225
unsafe impl RawDevice for Client {
0 commit comments