summaryrefslogtreecommitdiff
path: root/rust/kernel/device.rs
diff options
context:
space:
mode:
authorShankari Anand <shankari.ak0208@gmail.com>2025-08-14 16:16:15 +0530
committerDanilo Krummrich <dakr@kernel.org>2025-08-15 22:34:41 +0200
commit1e180614b3608e1cb0f81753b2172af253d58a52 (patch)
tree00932813583d3f7503320eda25826dca57957690 /rust/kernel/device.rs
parentb6a37d1d4694111895248b771513153ccace606a (diff)
rust: driver-core: Update ARef and AlwaysRefCounted imports from sync::aref
Update call sites in the driver-core files and its related samples 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> Link: https://lore.kernel.org/r/20250814104615.355106-1-shankari.ak0208@gmail.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/device.rs')
-rw-r--r--rust/kernel/device.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index b8613289de8e..b860ab389f18 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -6,7 +6,8 @@
use crate::{
bindings,
- types::{ARef, ForeignOwnable, Opaque},
+ sync::aref::ARef,
+ types::{ForeignOwnable, Opaque},
};
use core::{fmt, marker::PhantomData, ptr};
@@ -292,7 +293,7 @@ kernel::impl_device_context_deref!(unsafe { Device });
kernel::impl_device_context_into_aref!(Device);
// SAFETY: Instances of `Device` are always reference-counted.
-unsafe impl crate::types::AlwaysRefCounted for Device {
+unsafe impl crate::sync::aref::AlwaysRefCounted for Device {
fn inc_ref(&self) {
// SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
unsafe { bindings::get_device(self.as_raw()) };
@@ -411,7 +412,7 @@ macro_rules! impl_device_context_deref {
#[macro_export]
macro_rules! __impl_device_context_into_aref {
($src:ty, $device:tt) => {
- impl ::core::convert::From<&$device<$src>> for $crate::types::ARef<$device> {
+ impl ::core::convert::From<&$device<$src>> for $crate::sync::aref::ARef<$device> {
fn from(dev: &$device<$src>) -> Self {
(&**dev).into()
}