diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2025-10-21 00:34:29 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2025-10-29 18:29:32 +0100 |
| commit | 710ac546883c2cae6e8e7b5dcf7757b8a49d75a1 (patch) | |
| tree | 1cd930a1f71e3b3c370a7d934778edc31c778976 /samples/rust/rust_driver_auxiliary.rs | |
| parent | 675e514edd659b5cfc15eb70bd8abf53568947cc (diff) | |
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.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'samples/rust/rust_driver_auxiliary.rs')
| -rw-r--r-- | samples/rust/rust_driver_auxiliary.rs | 11 |
1 files 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 @@ impl pci::Driver for ParentDriver { } 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() ); |