Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+5 -6
+5 -6
samples/rust/rust_driver_auxiliary.rs
··· 70 70 } 71 71 72 72 impl ParentDriver { 73 - fn connect(adev: &auxiliary::Device) -> Result<()> { 74 - let parent = adev.parent(); 75 - let pdev: &pci::Device = parent.try_into()?; 73 + fn connect(adev: &auxiliary::Device) -> Result { 74 + let dev = adev.parent(); 75 + let pdev: &pci::Device = dev.try_into()?; 76 76 77 - let vendor = pdev.vendor_id(); 78 77 dev_info!( 79 - adev.as_ref(), 78 + dev, 80 79 "Connect auxiliary {} with parent: VendorID={}, DeviceID={:#x}\n", 81 80 adev.id(), 82 - vendor, 81 + pdev.vendor_id(), 83 82 pdev.device_id() 84 83 ); 85 84