diff options
author | Danilo Krummrich <dakr@kernel.org> | 2025-03-21 22:47:54 +0100 |
---|---|---|
committer | Danilo Krummrich <dakr@kernel.org> | 2025-04-19 10:20:16 +0200 |
commit | a095d0d1e4849ee25c28d43d713a8f433d7f1f27 (patch) | |
tree | 8e38d36066ae4862f6e297614a485d3096728393 /rust/kernel/platform.rs | |
parent | cfec9a16e6800b5489bd361f6b6ea9af65fb1050 (diff) |
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: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno 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: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/kernel/platform.rs')
0 files changed, 0 insertions, 0 deletions