Skip to contentSkip to conversation

rust: pci: fix documentation related to Device instances

PATCH In review Rahul Rameshbabu 2 participants 2 messages Jul 6, 2025 – Jul 7, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rust: pci: fix documentation related to Device instances

Device instances in the pci crate represent a valid struct pci_dev, not a struct device.

Fixes 7b948a2af6b5 ("rust: pci: fix unrestricted &mut pci::Device")

---

Notes:
Changes:

v1->v2:
* Added Fixes: git trailer
* Fixed warnings from ./scripts/checkpatch.pl

 rust/kernel/pci.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
rust/kernel/pci.rs +2 -1
index 6b94fd7a3ce9..b991fb440882 100644
@@ -254,7 +254,8 @@ pub trait Driver: Send {
 ///
 /// # Invariants
 ///
-/// A [`Device`] instance represents a valid `struct device` created by the C portion of the kernel.
+/// A [`Device`] instance represents a valid `struct pci_dev` created by the C portion of the
+/// kernel.
 #[repr(transparent)]
 pub struct Device<Ctx: device::DeviceContext = device::Normal>(
     Opaque<bindings::pci_dev>,

base-commit: 2009a2d5696944d85c34d75e691a6f3884e787c0

Signature · 1 line
2.47.2
maintainer
#1 lore raw
Quoted 5 lines · Rahul Rameshbabu

Device instances in the pci crate represent a valid struct pci_dev, not a struct device.

Fixes 7b948a2af6b5 ("rust: pci: fix unrestricted &mut pci::Device")

Applied to driver-core-testing, thanks!