Skip to content

Commit dfce283

Browse files
Shankari02ojeda
authored andcommitted
rust: i2c: Update ARef and AlwaysRefCounted imports to use sync::aref
Update call sites in `i2c.rs` to import `ARef` and `AlwaysRefCounted` from `sync::aref` instead of `types`. This aligns with the ongoing effort to move `ARef` and `AlwaysRefCounted` to sync. Suggested-by: Benno Lossin <lossin@kernel.org> Link: #1173 Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com> Acked-by: Igor Korotin <igor.korotin.linux@gmail.com> Link: https://patch.msgid.link/20260102202714.184223-3-shankari.ak0208@gmail.com [ Move `ARef` import into the `kernel` `use` tree above. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 1353b8f commit dfce283

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

rust/kernel/i2c.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ use crate::{
1616
error::*,
1717
of,
1818
prelude::*,
19-
types::{
20-
AlwaysRefCounted,
21-
Opaque, //
22-
}, //
19+
sync::aref::{
20+
ARef,
21+
AlwaysRefCounted, //
22+
},
23+
types::Opaque, //
2324
};
2425

2526
use core::{
@@ -31,8 +32,6 @@ use core::{
3132
}, //
3233
};
3334

34-
use kernel::types::ARef;
35-
3635
/// An I2C device id table.
3736
#[repr(transparent)]
3837
#[derive(Clone, Copy)]
@@ -416,7 +415,7 @@ kernel::impl_device_context_deref!(unsafe { I2cAdapter });
416415
kernel::impl_device_context_into_aref!(I2cAdapter);
417416

418417
// SAFETY: Instances of `I2cAdapter` are always reference-counted.
419-
unsafe impl crate::types::AlwaysRefCounted for I2cAdapter {
418+
unsafe impl AlwaysRefCounted for I2cAdapter {
420419
fn inc_ref(&self) {
421420
// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
422421
unsafe { bindings::i2c_get_adapter(self.index()) };

0 commit comments

Comments
 (0)