Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: dma: fix broken intra-doc links

The `pci` module is conditional on CONFIG_PCI. When it's disabled, the
intra-doc link to `pci::Device` causes rustdoc warnings:

warning: unresolved link to `::kernel::pci::Device`
--> rust/kernel/dma.rs:30:70
|
30 | /// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or
| ^^^^^^^^^^^^^^^^^^^^^ no item named `pci` in module `kernel`

Fix this by making the documentation conditional on CONFIG_PCI.

Fixes: d06d5f66f549 ("rust: dma: implement `dma::Device` trait")
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://patch.msgid.link/20251231045728.1912024-1-fujita.tomonori@gmail.com
[ Keep the "such as" part indicating a list of examples; fix typos in
commit message. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

FUJITA Tomonori and committed by
Danilo Krummrich
32cb3840 4c9f6a78

+3 -2
+3 -2
rust/kernel/dma.rs
··· 27 27 /// Trait to be implemented by DMA capable bus devices. 28 28 /// 29 29 /// The [`dma::Device`](Device) trait should be implemented by bus specific device representations, 30 - /// where the underlying bus is DMA capable, such as [`pci::Device`](::kernel::pci::Device) or 31 - /// [`platform::Device`](::kernel::platform::Device). 30 + /// where the underlying bus is DMA capable, such as: 31 + #[cfg_attr(CONFIG_PCI, doc = "* [`pci::Device`](kernel::pci::Device)")] 32 + /// * [`platform::Device`](::kernel::platform::Device) 32 33 pub trait Device: AsRef<device::Device<Core>> { 33 34 /// Set up the device's DMA streaming addressing capabilities. 34 35 ///