From: Gary Guo Date: Fri, 23 Jan 2026 17:58:40 +0000 (+0000) Subject: rust: samples: driver-core: remove redundant `.as_ref()` for `dev_*` print X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3be458a5a7ed57cb874474aee7929daed0d5d3aa;p=thirdparty%2Fkernel%2Flinux.git rust: samples: driver-core: remove redundant `.as_ref()` for `dev_*` print This is now handled by the macro itself. Signed-off-by: Gary Guo Link: https://patch.msgid.link/20260123175854.176735-3-gary@kernel.org Signed-off-by: Danilo Krummrich --- 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, _info: &Self::IdInfo) -> impl PinInit { 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 @@ 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 }) } 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 @@ 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"); } } 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 @@ impl platform::Driver for SampleSocDriver { pdev: &platform::Device, _info: Option<&Self::IdInfo>, ) -> impl PinInit { - 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 || {