[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020223516.241050-8-dakr@kernel.org>
Date: Tue, 21 Oct 2025 00:34:29 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: gregkh@...uxfoundation.org,
rafael@...nel.org,
bhelgaas@...gle.com,
kwilczynski@...nel.org,
david.m.ertman@...el.com,
ira.weiny@...el.com,
leon@...nel.org,
acourbot@...dia.com,
ojeda@...nel.org,
alex.gaynor@...il.com,
boqun.feng@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
lossin@...nel.org,
a.hindborg@...nel.org,
aliceryhl@...gle.com,
tmgross@...ch.edu,
pcolberg@...hat.com
Cc: rust-for-linux@...r.kernel.org,
linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Danilo Krummrich <dakr@...nel.org>
Subject: [PATCH 7/8] samples: rust: auxiliary: misc cleanup of ParentDriver::connect()
In ParentDriver::connect() rename parent to dev, use it for the
dev_info!() call, call pdev.vendor_() directly in the print statement
and remove the unnecessary generic type of Result.
Signed-off-by: Danilo Krummrich <dakr@...nel.org>
---
samples/rust/rust_driver_auxiliary.rs | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/samples/rust/rust_driver_auxiliary.rs b/samples/rust/rust_driver_auxiliary.rs
index 95c552ee9489..a5d67d4d9e83 100644
--- a/samples/rust/rust_driver_auxiliary.rs
+++ b/samples/rust/rust_driver_auxiliary.rs
@@ -70,16 +70,15 @@ fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> impl PinInit<Self, E
}
impl ParentDriver {
- fn connect(adev: &auxiliary::Device) -> Result<()> {
- let parent = adev.parent();
- let pdev: &pci::Device = parent.try_into()?;
+ fn connect(adev: &auxiliary::Device) -> Result {
+ let dev = adev.parent();
+ let pdev: &pci::Device = dev.try_into()?;
- let vendor = pdev.vendor_id();
dev_info!(
- adev.as_ref(),
+ dev,
"Connect auxiliary {} with parent: VendorID={}, DeviceID={:#x}\n",
adev.id(),
- vendor,
+ pdev.vendor_id(),
pdev.device_id()
);
--
2.51.0
Powered by blists - more mailing lists