]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: pci: provide access to PCI Vendor values
authorJohn Hubbard <jhubbard@nvidia.com>
Fri, 29 Aug 2025 22:36:28 +0000 (15:36 -0700)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 1 Sep 2025 18:05:22 +0000 (20:05 +0200)
commit5e20962a9fc8a0b5b91f0989d3baf03f02bc99cb
treea263682c0a135a4d0ae72a416291861ed3cb6748
parented78a01887e2257cff0412b640db68b70a2654dc
rust: pci: provide access to PCI Vendor values

This allows callers to write Vendor::SOME_COMPANY instead of
bindings::PCI_VENDOR_ID_SOME_COMPANY.

New APIs:
    Vendor::SOME_COMPANY
    Vendor::from_raw() -- Only accessible from the pci (parent) module.
    Vendor::as_raw()
    Vendor: fmt::Display for Vendor

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-3-jhubbard@nvidia.com
[ Minor doc-comment improvements, align Debug and Display. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/pci.rs
rust/kernel/pci/id.rs