summaryrefslogtreecommitdiff
path: root/rust/kernel/device.rs
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-08-13 11:39:49 -0400
committerMiguel Ojeda <ojeda@kernel.org>2025-09-16 09:26:58 +0200
commit97bcbe585476e67980a0873e89965254e1fd6a67 (patch)
tree1efa18cc88b9acb6100fe653a95be4dfc35c460d /rust/kernel/device.rs
parente0be3d34f1089fd9681a66f8295de91a77f55d7f (diff)
rust: device: use `kernel::{fmt,prelude::fmt!}`
Reduce coupling to implementation details of the formatting machinery by avoiding direct use for `core`'s formatting traits and macros. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/kernel/device.rs')
-rw-r--r--rust/kernel/device.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index 5902b3714a16..303af0ef9bf7 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -5,10 +5,10 @@
//! C header: [`include/linux/device.h`](srctree/include/linux/device.h)
use crate::{
- bindings,
+ bindings, fmt,
types::{ARef, ForeignOwnable, Opaque},
};
-use core::{fmt, marker::PhantomData, ptr};
+use core::{marker::PhantomData, ptr};
#[cfg(CONFIG_PRINTK)]
use crate::c_str;
@@ -595,7 +595,7 @@ macro_rules! impl_device_context_into_aref {
macro_rules! dev_printk {
($method:ident, $dev:expr, $($f:tt)*) => {
{
- ($dev).$method(::core::format_args!($($f)*));
+ ($dev).$method($crate::prelude::fmt!($($f)*));
}
}
}