Commit a095d0d1 authored by Danilo Krummrich's avatar Danilo Krummrich
Browse files

rust: pci: impl TryFrom<&Device> for &pci::Device



Implement TryFrom<&device::Device> for &Device.

This allows us to get a &pci::Device from a generic &Device in a safe
way; the conversion fails if the device' bus type does not match with
the PCI bus type.

Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20250321214826.140946-3-dakr@kernel.org


[ Support device context types, use dev_is_pci() helper. - Danilo ]
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent cfec9a16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment