[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260123175854.176735-3-gary@kernel.org>
Date: Fri, 23 Jan 2026 17:58:40 +0000
From: Gary Guo <gary@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
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>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Dave Ertman <david.m.ertman@...el.com>,
Ira Weiny <ira.weiny@...el.com>,
Leon Romanovsky <leon@...nel.org>
Cc: rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 3/8] rust: samples: driver-core: remove redundant `.as_ref()` for `dev_*` print
From: Gary Guo <gary@...yguo.net>
This is now handled by the macro itself.
Signed-off-by: Gary Guo <gary@...yguo.net>
---
samples/rust/rust_driver_auxiliary.rs | 2 +-
samples/rust/rust_driver_faux.rs | 2 +-
samples/rust/rust_driver_platform.rs | 2 +-
samples/rust/rust_soc.rs | 4 +---
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/samples/rust/rust_driver_auxiliary.rs b/samples/rust/rust_driver_auxiliary.rs
index f148124fe81f..c20961f16835 100644
--- a/samples/rust/rust_driver_auxiliary.rs
+++ b/samples/rust/rust_driver_auxiliary.rs
@@ -39,7 +39,7 @@ impl auxiliary::Driver for AuxiliaryDriver {
fn probe(adev: &auxiliary::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {
dev_info!(
- adev.as_ref(),
+ adev,
"Probing auxiliary driver for auxiliary device with id={}\n",
adev.id()
);
diff --git a/samples/rust/rust_driver_faux.rs b/samples/rust/rust_driver_faux.rs
index 5330b77ea986..99876c8e3743 100644
--- a/samples/rust/rust_driver_faux.rs
+++ b/samples/rust/rust_driver_faux.rs
@@ -26,7 +26,7 @@ fn init(_module: &'static ThisModule) -> Result<Self> {
let reg = faux::Registration::new(c"rust-faux-sample-device", None)?;
- dev_info!(reg.as_ref(), "Hello from faux device!\n");
+ dev_info!(reg, "Hello from faux device!\n");
Ok(Self { _reg: reg })
}
diff --git a/samples/rust/rust_driver_platform.rs b/samples/rust/rust_driver_platform.rs
index 9537dc38c563..f2229d176fb9 100644
--- a/samples/rust/rust_driver_platform.rs
+++ b/samples/rust/rust_driver_platform.rs
@@ -180,7 +180,7 @@ fn properties_parse(dev: &device::Device) -> Result {
impl Drop for SampleDriver {
fn drop(&mut self) {
- dev_dbg!(self.pdev.as_ref(), "Remove Rust Platform driver sample.\n");
+ dev_dbg!(self.pdev, "Remove Rust Platform driver sample.\n");
}
}
diff --git a/samples/rust/rust_soc.rs b/samples/rust/rust_soc.rs
index 403c1137af77..8079c1c48416 100644
--- a/samples/rust/rust_soc.rs
+++ b/samples/rust/rust_soc.rs
@@ -44,9 +44,7 @@ fn probe(
pdev: &platform::Device<Core>,
_info: Option<&Self::IdInfo>,
) -> impl PinInit<Self, Error> {
- let dev = pdev.as_ref();
-
- dev_dbg!(dev, "Probe Rust SoC driver sample.\n");
+ dev_dbg!(pdev, "Probe Rust SoC driver sample.\n");
let pdev = pdev.into();
pin_init_scope(move || {
--
2.51.2
Powered by blists - more mailing lists