rust: samples: driver-core: remove redundant `.as_ref()` for `dev_*` print
authorGary Guo <gary@garyguo.net>
Fri, 23 Jan 2026 17:58:40 +0000 (17:58 +0000)
committerDanilo Krummrich <dakr@kernel.org>
Sat, 24 Jan 2026 00:12:49 +0000 (01:12 +0100)
This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260123175854.176735-3-gary@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
samples/rust/rust_driver_auxiliary.rs
samples/rust/rust_driver_faux.rs
samples/rust/rust_driver_platform.rs
samples/rust/rust_soc.rs

index f148124..c20961f 100644 (file)
@@ -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()
         );
index 5330b77..99876c8 100644 (file)
@@ -26,7 +26,7 @@ impl Module for SampleModule {
 
         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 })
     }
index 9537dc3..f2229d1 100644 (file)
@@ -180,7 +180,7 @@ impl SampleDriver {
 
 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");
     }
 }
 
index 403c113..8079c1c 100644 (file)
@@ -44,9 +44,7 @@ impl platform::Driver for SampleSocDriver {
         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 || {