mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
rust: devres: fix doctest build under !CONFIG_PCI
The doctest requires `CONFIG_PCI`:
error[E0432]: unresolved import `kernel::pci`
--> rust/doctests_kernel_generated.rs:2689:44
|
2689 | use kernel::{device::Core, devres::Devres, pci};
| ^^^ no `pci` in the root
|
note: found an item that was configured out
--> rust/kernel/lib.rs:96:9
note: the item is gated here
--> rust/kernel/lib.rs:95:1
Thus conditionally compile it (which still checks the syntax).
Fixes: f301cb978c ("rust: devres: implement Devres::access()")
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://lore.kernel.org/r/20250511182533.1016163-1-ojeda@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
parent
b75a99e107
commit
42055939a3
|
|
@ -195,6 +195,7 @@ impl<T> Devres<T> {
|
|||
/// # Example
|
||||
///
|
||||
/// ```no_run
|
||||
/// # #![cfg(CONFIG_PCI)]
|
||||
/// # use kernel::{device::Core, devres::Devres, pci};
|
||||
///
|
||||
/// fn from_core(dev: &pci::Device<Core>, devres: Devres<pci::Bar<0x4>>) -> Result {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user