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>
This commit is contained in:
@@ -70,16 +70,15 @@ impl pci::Driver for ParentDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ParentDriver {
|
impl ParentDriver {
|
||||||
fn connect(adev: &auxiliary::Device) -> Result<()> {
|
fn connect(adev: &auxiliary::Device) -> Result {
|
||||||
let parent = adev.parent();
|
let dev = adev.parent();
|
||||||
let pdev: &pci::Device = parent.try_into()?;
|
let pdev: &pci::Device = dev.try_into()?;
|
||||||
|
|
||||||
let vendor = pdev.vendor_id();
|
|
||||||
dev_info!(
|
dev_info!(
|
||||||
adev.as_ref(),
|
dev,
|
||||||
"Connect auxiliary {} with parent: VendorID={}, DeviceID={:#x}\n",
|
"Connect auxiliary {} with parent: VendorID={}, DeviceID={:#x}\n",
|
||||||
adev.id(),
|
adev.id(),
|
||||||
vendor,
|
pdev.vendor_id(),
|
||||||
pdev.device_id()
|
pdev.device_id()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user