rust: auxiliary: consider auxiliary devices always have a parent

An auxiliary device is guaranteed to always have a parent device (both
in C and Rust), hence don't return an Option<&auxiliary::Device> in
auxiliary::Device::parent().

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:
Danilo Krummrich
2025-10-21 00:34:25 +02:00
parent 6f61a2637a
commit 589b061975
3 changed files with 6 additions and 5 deletions

View File

@@ -68,7 +68,7 @@ impl pci::Driver for ParentDriver {
impl ParentDriver {
fn connect(adev: &auxiliary::Device) -> Result<()> {
let parent = adev.parent().ok_or(EINVAL)?;
let parent = adev.parent();
let pdev: &pci::Device = parent.try_into()?;
let vendor = pdev.vendor_id();