[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251123092438.182251-6-shankari.ak0208@gmail.com>
Date: Sun, 23 Nov 2025 14:54:33 +0530
From: Shankari Anand <shankari.ak0208@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arve Hjønnevåg <arve@...roid.com>,
Todd Kjos <tkjos@...roid.com>,
Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joelagnelf@...dia.com>,
Christian Brauner <brauner@...nel.org>,
Carlos Llamas <cmllamas@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
Danilo Krummrich <dakr@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Alexandre Courbot <acourbot@...dia.com>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Igor Korotin <igor.korotin.linux@...il.com>,
Michal Wilczynski <m.wilczynski@...sung.com>
Cc: Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Daniel Almeida <daniel.almeida@...labora.com>,
Abdiel Janulgue <abdiel.janulgue@...il.com>,
Robin Murphy <robin.murphy@....com>,
linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
nouveau@...ts.freedesktop.org,
rust-for-linux@...r.kernel.org,
linux-pwm@...r.kernel.org,
Shankari Anand <shankari.ak0208@...il.com>
Subject: [PATCH 05/10] rust: kernel: 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@...nel.org>
Link: https://github.com/Rust-for-Linux/linux/issues/1173
Signed-off-by: Shankari Anand <shankari.ak0208@...il.com>
---
rust/kernel/i2c.rs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/rust/kernel/i2c.rs b/rust/kernel/i2c.rs
index 1aee46f59460..c50ca464d87c 100644
--- a/rust/kernel/i2c.rs
+++ b/rust/kernel/i2c.rs
@@ -17,10 +17,8 @@
of,
prelude::*,
str::CStrExt as _,
- types::{
- AlwaysRefCounted,
- Opaque, //
- }, //
+ sync::aref::AlwaysRefCounted,
+ types::Opaque, //
};
use core::{
@@ -32,7 +30,7 @@
}, //
};
-use kernel::types::ARef;
+use kernel::sync::aref::ARef;
/// An I2C device id table.
#[repr(transparent)]
@@ -408,7 +406,7 @@ pub fn get(index: i32) -> Result<ARef<Self>> {
kernel::impl_device_context_into_aref!(I2cAdapter);
// SAFETY: Instances of `I2cAdapter` are always reference-counted.
-unsafe impl crate::types::AlwaysRefCounted for I2cAdapter {
+unsafe impl crate::sync::aref::AlwaysRefCounted for I2cAdapter {
fn inc_ref(&self) {
// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
unsafe { bindings::i2c_get_adapter(self.index()) };
--
2.34.1
Powered by blists - more mailing lists