public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/8] rust: device: support `dev_printk` on all devices
@ 2026-01-23 17:58 Gary Guo
  2026-01-23 17:58 ` [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print Gary Guo
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross
  Cc: rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

Currently, `dev_*` only works on the core `Device`, but not on any other
bus or class device objects. This causes a pattern of
`dev_info!(pdev.as_ref())` which is not ideal.

This adds support of using these devices directly with `dev_*` macros, by
adding `AsRef` call inside the macro. To make sure we can still use just
`kernel::device::Device`, as `AsRef` implementation is added for it; this
is typical for types that is designed to use with `AsRef` anyway, for
example, `str` implements `AsRef<str>` and `Path` implements `AsRef<Path>`.

Signed-off-by: Gary Guo <gary@garyguo.net>
---

Notes:
    v1 -> v2:
    - split change to samples/rust to subsystems
    - converted more cases where `as_ref()` is only for dev_printk
    - Link to v1: https://lore.kernel.org/rust-for-linux/20260120181152.3640314-1-gary@kernel.org/

 rust/kernel/device.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
index c7b5db9dcca1..94e0548e7687 100644
--- a/rust/kernel/device.rs
+++ b/rust/kernel/device.rs
@@ -601,6 +601,13 @@ impl DeviceContext for Core {}
 impl DeviceContext for CoreInternal {}
 impl DeviceContext for Normal {}
 
+impl<Ctx: DeviceContext> AsRef<Device<Ctx>> for Device<Ctx> {
+    #[inline]
+    fn as_ref(&self) -> &Device<Ctx> {
+        self
+    }
+}
+
 /// Convert device references to bus device references.
 ///
 /// Bus devices can implement this trait to allow abstractions to provide the bus device in
@@ -720,7 +727,7 @@ macro_rules! impl_device_context_into_aref {
 macro_rules! dev_printk {
     ($method:ident, $dev:expr, $($f:tt)*) => {
         {
-            ($dev).$method($crate::prelude::fmt!($($f)*));
+            $crate::device::Device::$method($dev.as_ref(), $crate::prelude::fmt!($($f)*))
         }
     }
 }

base-commit: a0c666c25aeefd16f4b088c6549a6fb6b65a8a1d
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-24  0:38   ` Danilo Krummrich
  2026-01-23 17:58 ` [PATCH v2 3/8] rust: samples: driver-core: " Gary Guo
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Bjorn Helgaas, Krzysztof Wilczyński
  Cc: rust-for-linux, linux-kernel, linux-pci

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 rust/kernel/pci.rs              | 2 +-
 rust/kernel/pci/id.rs           | 2 +-
 samples/rust/rust_driver_pci.rs | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/rust/kernel/pci.rs b/rust/kernel/pci.rs
index bea76ca9c3da..3946ca919332 100644
--- a/rust/kernel/pci.rs
+++ b/rust/kernel/pci.rs
@@ -351,7 +351,7 @@ impl Device {
     ///     // Get an instance of `Vendor`.
     ///     let vendor = pdev.vendor_id();
     ///     dev_info!(
-    ///         pdev.as_ref(),
+    ///         pdev,
     ///         "Device: Vendor={}, Device=0x{:x}\n",
     ///         vendor,
     ///         pdev.device_id()
diff --git a/rust/kernel/pci/id.rs b/rust/kernel/pci/id.rs
index 42ffb1bbf87c..50005d176561 100644
--- a/rust/kernel/pci/id.rs
+++ b/rust/kernel/pci/id.rs
@@ -22,7 +22,7 @@
 /// fn probe_device(pdev: &pci::Device<Core>) -> Result {
 ///     let pci_class = pdev.pci_class();
 ///     dev_info!(
-///         pdev.as_ref(),
+///         pdev,
 ///         "Detected PCI class: {}\n",
 ///         pci_class
 ///     );
diff --git a/samples/rust/rust_driver_pci.rs b/samples/rust/rust_driver_pci.rs
index ef04c6401e6a..d50828b642e5 100644
--- a/samples/rust/rust_driver_pci.rs
+++ b/samples/rust/rust_driver_pci.rs
@@ -75,7 +75,7 @@ fn probe(pdev: &pci::Device<Core>, info: &Self::IdInfo) -> impl PinInit<Self, Er
         pin_init::pin_init_scope(move || {
             let vendor = pdev.vendor_id();
             dev_dbg!(
-                pdev.as_ref(),
+                pdev,
                 "Probe Rust PCI driver sample (PCI ID: {}, 0x{:x}).\n",
                 vendor,
                 pdev.device_id()
@@ -91,7 +91,7 @@ fn probe(pdev: &pci::Device<Core>, info: &Self::IdInfo) -> impl PinInit<Self, Er
                     let bar = bar.access(pdev.as_ref())?;
 
                     dev_info!(
-                        pdev.as_ref(),
+                        pdev,
                         "pci-testdev data-match count: {}\n",
                         Self::testdev(info, bar)?
                     );
@@ -112,7 +112,7 @@ fn unbind(pdev: &pci::Device<Core>, this: Pin<&Self>) {
 #[pinned_drop]
 impl PinnedDrop for SampleDriver {
     fn drop(self: Pin<&mut Self>) {
-        dev_dbg!(self.pdev.as_ref(), "Remove Rust PCI driver sample.\n");
+        dev_dbg!(self.pdev, "Remove Rust PCI driver sample.\n");
     }
 }
 
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 3/8] rust: samples: driver-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
  2026-01-23 17:58 ` [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-24  0:38   ` Danilo Krummrich
  2026-01-23 17:58 ` [PATCH v2 4/8] rust: samples: dma: " Gary Guo
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Dave Ertman, Ira Weiny, Leon Romanovsky
  Cc: rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 4/8] rust: samples: dma: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
  2026-01-23 17:58 ` [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print Gary Guo
  2026-01-23 17:58 ` [PATCH v2 3/8] rust: samples: driver-core: " Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-24  0:39   ` Danilo Krummrich
  2026-01-23 17:58 ` [PATCH v2 5/8] rust: samples: i2c: " Gary Guo
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Abdiel Janulgue, Daniel Almeida, Robin Murphy
  Cc: rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 samples/rust/rust_dma.rs | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/samples/rust/rust_dma.rs b/samples/rust/rust_dma.rs
index f53bce2a73e3..94effeb4eca4 100644
--- a/samples/rust/rust_dma.rs
+++ b/samples/rust/rust_dma.rs
@@ -57,7 +57,7 @@ impl pci::Driver for DmaSampleDriver {
 
     fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {
         pin_init::pin_init_scope(move || {
-            dev_info!(pdev.as_ref(), "Probe DMA test driver.\n");
+            dev_info!(pdev, "Probe DMA test driver.\n");
 
             let mask = DmaMask::new::<64>();
 
@@ -88,9 +88,7 @@ fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, E
 #[pinned_drop]
 impl PinnedDrop for DmaSampleDriver {
     fn drop(self: Pin<&mut Self>) {
-        let dev = self.pdev.as_ref();
-
-        dev_info!(dev, "Unload DMA test driver.\n");
+        dev_info!(self.pdev, "Unload DMA test driver.\n");
 
         for (i, value) in TEST_VALUES.into_iter().enumerate() {
             let val0 = kernel::dma_read!(self.ca[i].h);
@@ -107,7 +105,7 @@ fn drop(self: Pin<&mut Self>) {
         }
 
         for (i, entry) in self.sgt.iter().enumerate() {
-            dev_info!(dev, "Entry[{}]: DMA address: {:#x}", i, entry.dma_address());
+            dev_info!(self.pdev, "Entry[{}]: DMA address: {:#x}", i, entry.dma_address());
         }
     }
 }
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 5/8] rust: samples: i2c: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
                   ` (2 preceding siblings ...)
  2026-01-23 17:58 ` [PATCH v2 4/8] rust: samples: dma: " Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-27 18:52   ` Igor Korotin
  2026-01-23 17:58 ` [PATCH v2 6/8] rust: samples: usb: " Gary Guo
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Igor Korotin, Daniel Almeida
  Cc: rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.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


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 6/8] rust: samples: usb: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
                   ` (3 preceding siblings ...)
  2026-01-23 17:58 ` [PATCH v2 5/8] rust: samples: i2c: " Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-24  5:36   ` kernel test robot
  2026-01-23 17:58 ` [PATCH v2 7/8] gpu: nova-core: " Gary Guo
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross
  Cc: rust-for-linux, linux-kernel

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 samples/rust/rust_driver_usb.rs | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/samples/rust/rust_driver_usb.rs b/samples/rust/rust_driver_usb.rs
index ab72e99e1274..1da02fba3d09 100644
--- a/samples/rust/rust_driver_usb.rs
+++ b/samples/rust/rust_driver_usb.rs
@@ -33,15 +33,13 @@ fn probe(
         _id: &usb::DeviceId,
         _info: &Self::IdInfo,
     ) -> impl PinInit<Self, Error> {
-        let dev: &device::Device<Core> = intf.as_ref();
-        dev_info!(dev, "Rust USB driver sample probed\n");
+        dev_info!(intf, "Rust USB driver sample probed\n");
 
         Ok(Self { _intf: intf.into() })
     }
 
     fn disconnect(intf: &usb::Interface<Core>, _data: Pin<&Self>) {
-        let dev: &device::Device<Core> = intf.as_ref();
-        dev_info!(dev, "Rust USB driver sample disconnected\n");
+        dev_info!(intf, "Rust USB driver sample disconnected\n");
     }
 }
 
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 7/8] gpu: nova-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
                   ` (4 preceding siblings ...)
  2026-01-23 17:58 ` [PATCH v2 6/8] rust: samples: usb: " Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-24 13:07   ` Alexandre Courbot
                     ` (2 more replies)
  2026-01-23 17:58 ` [PATCH v2 8/8] gpu: tyr: " Gary Guo
                   ` (2 subsequent siblings)
  8 siblings, 3 replies; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Alexandre Courbot, David Airlie, Simona Vetter, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Alistair Popple,
	Joel Fernandes, Lyude Paul, John Hubbard
  Cc: rust-for-linux, linux-kernel, Timur Tabi, nouveau, dri-devel,
	linux-riscv

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Signed-off-by: Gary Guo <gary@garyguo.net>
---
 drivers/gpu/nova-core/driver.rs   |  2 +-
 drivers/gpu/nova-core/gpu.rs      |  4 ++--
 drivers/gpu/nova-core/gsp/boot.rs | 32 +++++++------------------------
 3 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
index 5a4cc047bcfc..e39885c0d5ca 100644
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@ -70,7 +70,7 @@ impl pci::Driver for NovaCore {
 
     fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, Error> {
         pin_init::pin_init_scope(move || {
-            dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n");
+            dev_dbg!(pdev, "Probe Nova Core GPU driver.\n");
 
             pdev.enable_device_mem()?;
             pdev.set_master();
diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 9b042ef1a308..60c85fffaeaf 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -262,13 +262,13 @@ pub(crate) fn new<'a>(
     ) -> impl PinInit<Self, Error> + 'a {
         try_pin_init!(Self {
             spec: Spec::new(pdev.as_ref(), bar).inspect(|spec| {
-                dev_info!(pdev.as_ref(),"NVIDIA ({})\n", spec);
+                dev_info!(pdev,"NVIDIA ({})\n", spec);
             })?,
 
             // We must wait for GFW_BOOT completion before doing any significant setup on the GPU.
             _: {
                 gfw::wait_gfw_boot_completion(bar)
-                    .inspect_err(|_| dev_err!(pdev.as_ref(), "GFW boot did not complete\n"))?;
+                    .inspect_err(|_| dev_err!(pdev, "GFW boot did not complete\n"))?;
             },
 
             sysmem_flush: SysmemFlush::register(pdev.as_ref(), bar, spec.chipset)?,
diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index 581b412554dc..1582e1a65274 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -170,15 +170,10 @@ pub(crate) fn boot(
             Some(libos_handle as u32),
             Some((libos_handle >> 32) as u32),
         )?;
-        dev_dbg!(
-            pdev.as_ref(),
-            "GSP MBOX0: {:#x}, MBOX1: {:#x}\n",
-            mbox0,
-            mbox1
-        );
+        dev_dbg!(pdev, "GSP MBOX0: {:#x}, MBOX1: {:#x}\n", mbox0, mbox1);
 
         dev_dbg!(
-            pdev.as_ref(),
+            pdev,
             "Using SEC2 to load and run the booter_load firmware...\n"
         );
 
@@ -190,19 +185,10 @@ pub(crate) fn boot(
             Some(wpr_handle as u32),
             Some((wpr_handle >> 32) as u32),
         )?;
-        dev_dbg!(
-            pdev.as_ref(),
-            "SEC2 MBOX0: {:#x}, MBOX1{:#x}\n",
-            mbox0,
-            mbox1
-        );
+        dev_dbg!(pdev, "SEC2 MBOX0: {:#x}, MBOX1{:#x}\n", mbox0, mbox1);
 
         if mbox0 != 0 {
-            dev_err!(
-                pdev.as_ref(),
-                "Booter-load failed with error {:#x}\n",
-                mbox0
-            );
+            dev_err!(pdev, "Booter-load failed with error {:#x}\n", mbox0);
             return Err(ENODEV);
         }
 
@@ -216,11 +202,7 @@ pub(crate) fn boot(
             Delta::from_secs(5),
         )?;
 
-        dev_dbg!(
-            pdev.as_ref(),
-            "RISC-V active? {}\n",
-            gsp_falcon.is_riscv_active(bar),
-        );
+        dev_dbg!(pdev, "RISC-V active? {}\n", gsp_falcon.is_riscv_active(bar),);
 
         // Create and run the GSP sequencer.
         let seq_params = GspSequencerParams {
@@ -239,8 +221,8 @@ pub(crate) fn boot(
         // Obtain and display basic GPU information.
         let info = commands::get_gsp_info(&mut self.cmdq, bar)?;
         match info.gpu_name() {
-            Ok(name) => dev_info!(pdev.as_ref(), "GPU name: {}\n", name),
-            Err(e) => dev_warn!(pdev.as_ref(), "GPU name unavailable: {:?}\n", e),
+            Ok(name) => dev_info!(pdev, "GPU name: {}\n", name),
+            Err(e) => dev_warn!(pdev, "GPU name unavailable: {:?}\n", e),
         }
 
         Ok(())
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 8/8] gpu: tyr: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
                   ` (5 preceding siblings ...)
  2026-01-23 17:58 ` [PATCH v2 7/8] gpu: nova-core: " Gary Guo
@ 2026-01-23 17:58 ` Gary Guo
  2026-01-24  0:37 ` [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Danilo Krummrich
  2026-01-24  6:31 ` Dirk Behme
  8 siblings, 0 replies; 20+ messages in thread
From: Gary Guo @ 2026-01-23 17:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Daniel Almeida, David Airlie, Simona Vetter
  Cc: rust-for-linux, linux-kernel, dri-devel

From: Gary Guo <gary@garyguo.net>

This is now handled by the macro itself.

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
---
 drivers/gpu/drm/tyr/driver.rs | 2 +-
 drivers/gpu/drm/tyr/gpu.rs    | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index 2a45d0288825..fe991d8cbb4a 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -140,7 +140,7 @@ fn probe(
 
         // We need this to be dev_info!() because dev_dbg!() does not work at
         // all in Rust for now, and we need to see whether probe succeeded.
-        dev_info!(pdev.as_ref(), "Tyr initialized correctly.\n");
+        dev_info!(pdev, "Tyr initialized correctly.\n");
         Ok(driver)
     }
 }
diff --git a/drivers/gpu/drm/tyr/gpu.rs b/drivers/gpu/drm/tyr/gpu.rs
index 6395ffcfdc57..64ca8311d4e8 100644
--- a/drivers/gpu/drm/tyr/gpu.rs
+++ b/drivers/gpu/drm/tyr/gpu.rs
@@ -98,7 +98,7 @@ pub(crate) fn log(&self, pdev: &platform::Device) {
         };
 
         dev_info!(
-            pdev.as_ref(),
+            pdev,
             "mali-{} id 0x{:x} major 0x{:x} minor 0x{:x} status 0x{:x}",
             model_name,
             self.gpu_id >> 16,
@@ -108,7 +108,7 @@ pub(crate) fn log(&self, pdev: &platform::Device) {
         );
 
         dev_info!(
-            pdev.as_ref(),
+            pdev,
             "Features: L2:{:#x} Tiler:{:#x} Mem:{:#x} MMU:{:#x} AS:{:#x}",
             self.l2_features,
             self.tiler_features,
@@ -118,7 +118,7 @@ pub(crate) fn log(&self, pdev: &platform::Device) {
         );
 
         dev_info!(
-            pdev.as_ref(),
+            pdev,
             "shader_present=0x{:016x} l2_present=0x{:016x} tiler_present=0x{:016x}",
             self.shader_present,
             self.l2_present,
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 1/8] rust: device: support `dev_printk` on all devices
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
                   ` (6 preceding siblings ...)
  2026-01-23 17:58 ` [PATCH v2 8/8] gpu: tyr: " Gary Guo
@ 2026-01-24  0:37 ` Danilo Krummrich
  2026-01-24  6:31 ` Dirk Behme
  8 siblings, 0 replies; 20+ messages in thread
From: Danilo Krummrich @ 2026-01-24  0:37 UTC (permalink / raw)
  To: Gary Guo
  Cc: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, rust-for-linux, linux-kernel

On Fri Jan 23, 2026 at 6:58 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> Currently, `dev_*` only works on the core `Device`, but not on any other
> bus or class device objects. This causes a pattern of
> `dev_info!(pdev.as_ref())` which is not ideal.
>
> This adds support of using these devices directly with `dev_*` macros, by
> adding `AsRef` call inside the macro. To make sure we can still use just
> `kernel::device::Device`, as `AsRef` implementation is added for it; this
> is typical for types that is designed to use with `AsRef` anyway, for
> example, `str` implements `AsRef<str>` and `Path` implements `AsRef<Path>`.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Applied to driver-core-testing, thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print Gary Guo
@ 2026-01-24  0:38   ` Danilo Krummrich
  0 siblings, 0 replies; 20+ messages in thread
From: Danilo Krummrich @ 2026-01-24  0:38 UTC (permalink / raw)
  To: Gary Guo
  Cc: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Bjorn Helgaas,
	Krzysztof Wilczyński, rust-for-linux, linux-kernel,
	linux-pci

On Fri Jan 23, 2026 at 6:58 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> This is now handled by the macro itself.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Applied to driver-core-testing, thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 3/8] rust: samples: driver-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 3/8] rust: samples: driver-core: " Gary Guo
@ 2026-01-24  0:38   ` Danilo Krummrich
  0 siblings, 0 replies; 20+ messages in thread
From: Danilo Krummrich @ 2026-01-24  0:38 UTC (permalink / raw)
  To: Gary Guo
  Cc: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Dave Ertman, Ira Weiny, Leon Romanovsky,
	rust-for-linux, linux-kernel

On Fri Jan 23, 2026 at 6:58 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> This is now handled by the macro itself.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Applied to driver-core-testing, thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 4/8] rust: samples: dma: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 4/8] rust: samples: dma: " Gary Guo
@ 2026-01-24  0:39   ` Danilo Krummrich
  0 siblings, 0 replies; 20+ messages in thread
From: Danilo Krummrich @ 2026-01-24  0:39 UTC (permalink / raw)
  To: Gary Guo
  Cc: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Miguel Ojeda,
	Boqun Feng, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Abdiel Janulgue, Daniel Almeida,
	Robin Murphy, rust-for-linux, linux-kernel

On Fri Jan 23, 2026 at 6:58 PM CET, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> This is now handled by the macro itself.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Applied to driver-core-testing, thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 6/8] rust: samples: usb: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 6/8] rust: samples: usb: " Gary Guo
@ 2026-01-24  5:36   ` kernel test robot
  0 siblings, 0 replies; 20+ messages in thread
From: kernel test robot @ 2026-01-24  5:36 UTC (permalink / raw)
  To: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross
  Cc: llvm, oe-kbuild-all, rust-for-linux, linux-kernel

Hi Gary,

kernel test robot noticed the following build warnings:

[auto build test WARNING on a0c666c25aeefd16f4b088c6549a6fb6b65a8a1d]

url:    https://github.com/intel-lab-lkp/linux/commits/Gary-Guo/rust-pci-remove-redundant-as_ref-for-dev_-print/20260124-020452
base:   a0c666c25aeefd16f4b088c6549a6fb6b65a8a1d
patch link:    https://lore.kernel.org/r/20260123175854.176735-6-gary%40kernel.org
patch subject: [PATCH v2 6/8] rust: samples: usb: remove redundant `.as_ref()` for `dev_*` print
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260124/202601241311.4vcnMzFr-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260124/202601241311.4vcnMzFr-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601241311.4vcnMzFr-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> warning: unused import: `self`
   --> samples/rust/rust_driver_usb.rs:8:9
   |
   8 |         self,
   |         ^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 1/8] rust: device: support `dev_printk` on all devices
  2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
                   ` (7 preceding siblings ...)
  2026-01-24  0:37 ` [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Danilo Krummrich
@ 2026-01-24  6:31 ` Dirk Behme
  8 siblings, 0 replies; 20+ messages in thread
From: Dirk Behme @ 2026-01-24  6:31 UTC (permalink / raw)
  To: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross
  Cc: rust-for-linux, linux-kernel

On 23.01.26 18:58, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
> 
> Currently, `dev_*` only works on the core `Device`, but not on any other
> bus or class device objects. This causes a pattern of
> `dev_info!(pdev.as_ref())` which is not ideal.
> 
> This adds support of using these devices directly with `dev_*` macros, by
> adding `AsRef` call inside the macro. To make sure we can still use just
> `kernel::device::Device`, as `AsRef` implementation is added for it; this
> is typical for types that is designed to use with `AsRef` anyway, for
> example, `str` implements `AsRef<str>` and `Path` implements `AsRef<Path>`.
> 
> Signed-off-by: Gary Guo <gary@garyguo.net>
> ---
> 
> Notes:
>     v1 -> v2:
>     - split change to samples/rust to subsystems
>     - converted more cases where `as_ref()` is only for dev_printk


Many thanks for adding the additional cases!

With the discussion in [1], I think the rule of thumb is now:

* If `&Device` is only needed specifically for printing, then no
`.as_ref()` and no helper variable are needed any more (as done in
this patch series).
* If you already need to obtain `&Device` not only for printing, but
also for other use cases, then a helper variable like `let dev =
pdev.as_ref();` is fine. An example is `probe()` in
samples/rust/rust_driver_platform.rs [2].

I think we have a trivial warning from the kernel test robot on the
USB one, now. But with that fixed (if its not too late already):

Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>

Thanks,

Dirk

[1]
https://lore.kernel.org/rust-for-linux/DFW5LUIQVZK0.2W01YO54KTKR7@garyguo.net/

[2]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/samples/rust/rust_driver_platform.rs#n103


>     - Link to v1: https://lore.kernel.org/rust-for-linux/20260120181152.3640314-1-gary@kernel.org/
> 
>  rust/kernel/device.rs | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs
> index c7b5db9dcca1..94e0548e7687 100644
> --- a/rust/kernel/device.rs
> +++ b/rust/kernel/device.rs
> @@ -601,6 +601,13 @@ impl DeviceContext for Core {}
>  impl DeviceContext for CoreInternal {}
>  impl DeviceContext for Normal {}
>  
> +impl<Ctx: DeviceContext> AsRef<Device<Ctx>> for Device<Ctx> {
> +    #[inline]
> +    fn as_ref(&self) -> &Device<Ctx> {
> +        self
> +    }
> +}
> +
>  /// Convert device references to bus device references.
>  ///
>  /// Bus devices can implement this trait to allow abstractions to provide the bus device in
> @@ -720,7 +727,7 @@ macro_rules! impl_device_context_into_aref {
>  macro_rules! dev_printk {
>      ($method:ident, $dev:expr, $($f:tt)*) => {
>          {
> -            ($dev).$method($crate::prelude::fmt!($($f)*));
> +            $crate::device::Device::$method($dev.as_ref(), $crate::prelude::fmt!($($f)*))
>          }
>      }
>  }
> 
> base-commit: a0c666c25aeefd16f4b088c6549a6fb6b65a8a1d


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 7/8] gpu: nova-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 7/8] gpu: nova-core: " Gary Guo
@ 2026-01-24 13:07   ` Alexandre Courbot
  2026-01-24 13:29     ` Danilo Krummrich
  2026-02-24 14:17   ` Danilo Krummrich
  2026-02-27 19:30   ` Aditya Rajan
  2 siblings, 1 reply; 20+ messages in thread
From: Alexandre Courbot @ 2026-01-24 13:07 UTC (permalink / raw)
  To: Gary Guo
  Cc: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, David Airlie,
	Simona Vetter, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Alistair Popple, Joel Fernandes, Lyude Paul,
	John Hubbard, rust-for-linux, linux-kernel, nouveau, dri-devel,
	linux-riscv

On Sat Jan 24, 2026 at 2:58 AM JST, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
>
> This is now handled by the macro itself.
>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Acked-by: Alexandre Courbot <acourbot@nvidia.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 7/8] gpu: nova-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-24 13:07   ` Alexandre Courbot
@ 2026-01-24 13:29     ` Danilo Krummrich
  2026-02-13  0:11       ` Alexandre Courbot
  0 siblings, 1 reply; 20+ messages in thread
From: Danilo Krummrich @ 2026-01-24 13:29 UTC (permalink / raw)
  To: Alexandre Courbot
  Cc: Gary Guo, Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki,
	Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, David Airlie,
	Simona Vetter, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, Alistair Popple, Joel Fernandes, Lyude Paul,
	John Hubbard, rust-for-linux, linux-kernel, nouveau, dri-devel,
	linux-riscv

On Sat Jan 24, 2026 at 2:07 PM CET, Alexandre Courbot wrote:
> On Sat Jan 24, 2026 at 2:58 AM JST, Gary Guo wrote:
>> From: Gary Guo <gary@garyguo.net>
>>
>> This is now handled by the macro itself.
>>
>> Signed-off-by: Gary Guo <gary@garyguo.net>
>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>

We should take this through drm-rust in the next cycle to avoid conflicts.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 5/8] rust: samples: i2c: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 5/8] rust: samples: i2c: " Gary Guo
@ 2026-01-27 18:52   ` Igor Korotin
  0 siblings, 0 replies; 20+ messages in thread
From: Igor Korotin @ 2026-01-27 18:52 UTC (permalink / raw)
  To: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Igor Korotin,
	Daniel Almeida
  Cc: rust-for-linux, linux-kernel

Hi

On 1/23/2026 5:58 PM, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
> 
> This is now handled by the macro itself.
> 
> Signed-off-by: Gary Guo <gary@garyguo.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");
>       }
>   }
>   

Acked-by: Igor Korotin <igor.korotin.linux@gmail.com>

Thanks
Igor

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 7/8] gpu: nova-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-24 13:29     ` Danilo Krummrich
@ 2026-02-13  0:11       ` Alexandre Courbot
  0 siblings, 0 replies; 20+ messages in thread
From: Alexandre Courbot @ 2026-02-13  0:11 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: Gary Guo, Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki,
	Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Simona Vetter,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Alistair Popple, Joel Fernandes, rust-for-linux, linux-kernel,
	nouveau, dri-devel, linux-riscv

On Sat Jan 24, 2026 at 10:29 PM JST, Danilo Krummrich wrote:
> On Sat Jan 24, 2026 at 2:07 PM CET, Alexandre Courbot wrote:
>> On Sat Jan 24, 2026 at 2:58 AM JST, Gary Guo wrote:
>>> From: Gary Guo <gary@garyguo.net>
>>>
>>> This is now handled by the macro itself.
>>>
>>> Signed-off-by: Gary Guo <gary@garyguo.net>
>>
>> Acked-by: Alexandre Courbot <acourbot@nvidia.com>
>
> We should take this through drm-rust in the next cycle to avoid conflicts.

Took into my queue for merging into `drm-rust-next` as soon as it
repoens.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 7/8] gpu: nova-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 7/8] gpu: nova-core: " Gary Guo
  2026-01-24 13:07   ` Alexandre Courbot
@ 2026-02-24 14:17   ` Danilo Krummrich
  2026-02-27 19:30   ` Aditya Rajan
  2 siblings, 0 replies; 20+ messages in thread
From: Danilo Krummrich @ 2026-02-24 14:17 UTC (permalink / raw)
  To: Gary Guo
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Miguel Ojeda, Boqun Feng,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Alexandre Courbot, David Airlie, Simona Vetter,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Alistair Popple, Joel Fernandes, Lyude Paul, John Hubbard,
	rust-for-linux, linux-kernel, Timur Tabi, nouveau, dri-devel,
	linux-riscv

On 1/23/26 6:58 PM, Gary Guo wrote:
> From: Gary Guo <gary@garyguo.net>
> 
> This is now handled by the macro itself.
> 
> Signed-off-by: Gary Guo <gary@garyguo.net>

Applied to drm-rust-next, thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 7/8] gpu: nova-core: remove redundant `.as_ref()` for `dev_*` print
  2026-01-23 17:58 ` [PATCH v2 7/8] gpu: nova-core: " Gary Guo
  2026-01-24 13:07   ` Alexandre Courbot
  2026-02-24 14:17   ` Danilo Krummrich
@ 2026-02-27 19:30   ` Aditya Rajan
  2 siblings, 0 replies; 20+ messages in thread
From: Aditya Rajan @ 2026-02-27 19:30 UTC (permalink / raw)
  To: Gary Guo, Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Miguel Ojeda, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Alexandre Courbot,
	David Airlie, Simona Vetter, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, Alistair Popple, Joel Fernandes,
	Lyude Paul, John Hubbard
  Cc: rust-for-linux, linux-kernel, nouveau, dri-devel, linux-riscv

On Fri Jan 23, 2026 at 9:58 AM PST, Gary Guo wrote:
> +        dev_dbg!(pdev, "SEC2 MBOX0: {:#x}, MBOX1{:#x}\n", mbox0, mbox1);
Nit: Missing colon after MBOX1, should it be `MBOX1: {:#x}`.

Thanks!




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-02-27 19:30 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 17:58 [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Gary Guo
2026-01-23 17:58 ` [PATCH v2 2/8] rust: pci: remove redundant `.as_ref()` for `dev_*` print Gary Guo
2026-01-24  0:38   ` Danilo Krummrich
2026-01-23 17:58 ` [PATCH v2 3/8] rust: samples: driver-core: " Gary Guo
2026-01-24  0:38   ` Danilo Krummrich
2026-01-23 17:58 ` [PATCH v2 4/8] rust: samples: dma: " Gary Guo
2026-01-24  0:39   ` Danilo Krummrich
2026-01-23 17:58 ` [PATCH v2 5/8] rust: samples: i2c: " Gary Guo
2026-01-27 18:52   ` Igor Korotin
2026-01-23 17:58 ` [PATCH v2 6/8] rust: samples: usb: " Gary Guo
2026-01-24  5:36   ` kernel test robot
2026-01-23 17:58 ` [PATCH v2 7/8] gpu: nova-core: " Gary Guo
2026-01-24 13:07   ` Alexandre Courbot
2026-01-24 13:29     ` Danilo Krummrich
2026-02-13  0:11       ` Alexandre Courbot
2026-02-24 14:17   ` Danilo Krummrich
2026-02-27 19:30   ` Aditya Rajan
2026-01-23 17:58 ` [PATCH v2 8/8] gpu: tyr: " Gary Guo
2026-01-24  0:37 ` [PATCH v2 1/8] rust: device: support `dev_printk` on all devices Danilo Krummrich
2026-01-24  6:31 ` Dirk Behme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox