mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user