]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: pci: use pci::Vendor instead of bindings::PCI_VENDOR_ID_*
authorJohn Hubbard <jhubbard@nvidia.com>
Fri, 29 Aug 2025 22:36:31 +0000 (15:36 -0700)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 1 Sep 2025 18:16:36 +0000 (20:16 +0200)
commit1b8ac37677d307cd0fc10f6bf9bceae2c282bdb4
tree6f68463b09b7a8038a5bd15a695ba517e8ea476e
parent6783d3b08595e932938a244e97d92cda0c0833a1
rust: pci: use pci::Vendor instead of bindings::PCI_VENDOR_ID_*

Change Device::vendor_id() to return a Vendor type, and change
DeviceId::from_id() to accept a Vendor type.

Use the new pci::Vendor in the various Rust for Linux callers who were
previously using bindings::PCI_VENDOR_ID_*.

Doing so also allows removing "use kernel::bindings" entirely from most
of the affected files here.

Also, mark vendor_id() as inline.

Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Elle Rhumsaa <elle@weathered-steel.dev>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Link: https://lore.kernel.org/r/20250829223632.144030-6-jhubbard@nvidia.com
[ Replace "as a validated vendor" with "as [`Vendor`]". - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/pci.rs
rust/kernel/pci/id.rs
samples/rust/rust_dma.rs
samples/rust/rust_driver_auxiliary.rs
samples/rust/rust_driver_pci.rs