Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: https://github.com/Rust-for-Linux/linux/issues/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>

authored by

Shankari Anand and committed by
Miguel Ojeda
dfce2833 1353b8f3

+6 -7
+6 -7
rust/kernel/i2c.rs
··· 16 16 error::*, 17 17 of, 18 18 prelude::*, 19 - types::{ 20 - AlwaysRefCounted, 21 - Opaque, // 22 - }, // 19 + sync::aref::{ 20 + ARef, 21 + AlwaysRefCounted, // 22 + }, 23 + types::Opaque, // 23 24 }; 24 25 25 26 use core::{ ··· 31 30 NonNull, // 32 31 }, // 33 32 }; 34 - 35 - use kernel::types::ARef; 36 33 37 34 /// An I2C device id table. 38 35 #[repr(transparent)] ··· 415 416 kernel::impl_device_context_into_aref!(I2cAdapter); 416 417 417 418 // SAFETY: Instances of `I2cAdapter` are always reference-counted. 418 - unsafe impl crate::types::AlwaysRefCounted for I2cAdapter { 419 + unsafe impl AlwaysRefCounted for I2cAdapter { 419 420 fn inc_ref(&self) { 420 421 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero. 421 422 unsafe { bindings::i2c_get_adapter(self.index()) };