Re: [PATCH] rust: device: fix unresolved link to drm::Device
From: Alice Ryhl
Date: Sat Aug 30 2025 - 04:20:35 EST
On Fri, Aug 29, 2025 at 9:58 PM Danilo Krummrich <dakr@xxxxxxxxxx> wrote:
>
> drm::Device is only available when CONFIG_DRM=y, which we have to
> consider for intra-doc links, otherwise the rustdoc make target produces
> the following warning.
>
> >> warning: unresolved link to `kernel::drm::Device`
> --> rust/kernel/device.rs:154:22
> |
> 154 | /// [`drm::Device`]: kernel::drm::Device
> | ^^^^^^^^^^^^^^^^^^^ no item named `drm` in module `kernel`
> |
> = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
>
> Fix this by making the intra-doc link conditional on CONFIG_DRM being enabled.
>
> Fixes: d6e26c1ae4a6 ("device: rust: expand documentation for Device")
> Suggested-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202508261644.9LclwUgt-lkp@xxxxxxxxx/
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>