[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260123175854.176735-5-gary@kernel.org>
Date: Fri, 23 Jan 2026 17:58:42 +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>,
Igor Korotin <igor.korotin.linux@...il.com>,
Daniel Almeida <daniel.almeida@...labora.com>
Cc: rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 5/8] rust: samples: i2c: 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_i2c.rs | 10 ++++------
samples/rust/rust_i2c_client.rs | 10 ++--------
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/samples/rust/rust_driver_i2c.rs b/samples/rust/rust_driver_i2c.rs
index 6be79f9e9fb5..3079d57fe473 100644
--- a/samples/rust/rust_driver_i2c.rs
+++ b/samples/rust/rust_driver_i2c.rs
@@ -44,23 +44,21 @@ fn probe(
idev: &i2c::I2cClient<Core>,
info: Option<&Self::IdInfo>,
) -> impl PinInit<Self, Error> {
- let dev = idev.as_ref();
-
- dev_info!(dev, "Probe Rust I2C driver sample.\n");
+ dev_info!(idev, "Probe Rust I2C driver sample.\n");
if let Some(info) = info {
- dev_info!(dev, "Probed with info: '{}'.\n", info);
+ dev_info!(idev, "Probed with info: '{}'.\n", info);
}
Ok(Self)
}
fn shutdown(idev: &i2c::I2cClient<Core>, _this: Pin<&Self>) {
- dev_info!(idev.as_ref(), "Shutdown Rust I2C driver sample.\n");
+ dev_info!(idev, "Shutdown Rust I2C driver sample.\n");
}
fn unbind(idev: &i2c::I2cClient<Core>, _this: Pin<&Self>) {
- dev_info!(idev.as_ref(), "Unbind Rust I2C driver sample.\n");
+ dev_info!(idev, "Unbind Rust I2C driver sample.\n");
}
}
diff --git a/samples/rust/rust_i2c_client.rs b/samples/rust/rust_i2c_client.rs
index 8d2c12e535b0..72da5499f150 100644
--- a/samples/rust/rust_i2c_client.rs
+++ b/samples/rust/rust_i2c_client.rs
@@ -113,10 +113,7 @@ fn probe(
pdev: &platform::Device<device::Core>,
_info: Option<&Self::IdInfo>,
) -> impl PinInit<Self, Error> {
- dev_info!(
- pdev.as_ref(),
- "Probe Rust I2C Client registration sample.\n"
- );
+ dev_info!(pdev, "Probe Rust I2C Client registration sample.\n");
kernel::try_pin_init!( Self {
parent_dev: pdev.into(),
@@ -130,10 +127,7 @@ fn probe(
}
fn unbind(pdev: &platform::Device<device::Core>, _this: Pin<&Self>) {
- dev_info!(
- pdev.as_ref(),
- "Unbind Rust I2C Client registration sample.\n"
- );
+ dev_info!(pdev, "Unbind Rust I2C Client registration sample.\n");
}
}
--
2.51.2
Powered by blists - more mailing lists