* [PATCH] rust: driver: fix broken intra-doc links to example driver types
@ 2025-12-27 15:47 Alice Ryhl
2025-12-30 21:18 ` Miguel Ojeda
2025-12-30 22:32 ` Danilo Krummrich
0 siblings, 2 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-12-27 15:47 UTC (permalink / raw)
To: Danilo Krummrich, Greg Kroah-Hartman
Cc: Rafael J. Wysocki, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Alexandre Courbot, rust-for-linux,
linux-kernel, Alice Ryhl
The `auxiliary` and `pci` modules are conditional on
`CONFIG_AUXILIARY_BUS` and `CONFIG_PCI` respectively. When these are
disabled, the intra-doc links to `auxiliary::Driver` and `pci::Driver`
break, causing rustdoc warnings (or errors with `-D warnings`).
error: unresolved link to `kernel::auxiliary::Driver`
--> rust/kernel/driver.rs:82:28
|
82 | //! [`auxiliary::Driver`]: kernel::auxiliary::Driver
| ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `auxiliary` in module `kernel`
Fix this by making the documentation for these examples conditional on
the corresponding configuration options.
Fixes: 970a7c68788e ("driver: rust: expand documentation for driver infrastructure")
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
rust/kernel/driver.rs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs
index 9beae2e3d57e72d5155419bc16f58896a3fc38d7..649d06468f411ddf80fac5f3be22d9f83fd404df 100644
--- a/rust/kernel/driver.rs
+++ b/rust/kernel/driver.rs
@@ -33,7 +33,14 @@
//! }
//! ```
//!
-//! For specific examples see [`auxiliary::Driver`], [`pci::Driver`] and [`platform::Driver`].
+//! For specific examples see:
+//!
+//! * [`platform::Driver`](kernel::platform::Driver)
+#"
+)]
+#")]
//!
//! The `probe()` callback should return a `impl PinInit<Self, Error>`, i.e. the driver's private
//! data. The bus abstraction should store the pointer in the corresponding bus device. The generic
@@ -79,7 +86,6 @@
//!
//! For this purpose the generic infrastructure in [`device_id`] should be used.
//!
-//! [`auxiliary::Driver`]: kernel::auxiliary::Driver
//! [`Core`]: device::Core
//! [`Device`]: device::Device
//! [`Device<Core>`]: device::Device<device::Core>
@@ -87,8 +93,6 @@
//! [`DeviceContext`]: device::DeviceContext
//! [`device_id`]: kernel::device_id
//! [`module_driver`]: kernel::module_driver
-//! [`pci::Driver`]: kernel::pci::Driver
-//! [`platform::Driver`]: kernel::platform::Driver
use crate::error::{Error, Result};
use crate::{acpi, device, of, str::CStr, try_pin_init, types::Opaque, ThisModule};
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251227-driver-types-5a42cb829b71
Best regards,
--
Alice Ryhl <aliceryhl@google.com>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: driver: fix broken intra-doc links to example driver types
2025-12-27 15:47 [PATCH] rust: driver: fix broken intra-doc links to example driver types Alice Ryhl
@ 2025-12-30 21:18 ` Miguel Ojeda
2025-12-30 22:59 ` Alice Ryhl
2025-12-30 22:32 ` Danilo Krummrich
1 sibling, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2025-12-30 21:18 UTC (permalink / raw)
To: Alice Ryhl, FUJITA Tomonori
Cc: Danilo Krummrich, Greg Kroah-Hartman, Rafael J. Wysocki,
Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Trevor Gross, Daniel Almeida,
Alexandre Courbot, rust-for-linux, linux-kernel, David Gow
On Sat, Dec 27, 2025 at 4:47 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> The `auxiliary` and `pci` modules are conditional on
> `CONFIG_AUXILIARY_BUS` and `CONFIG_PCI` respectively. When these are
> disabled, the intra-doc links to `auxiliary::Driver` and `pci::Driver`
> break, causing rustdoc warnings (or errors with `-D warnings`).
>
> error: unresolved link to `kernel::auxiliary::Driver`
> --> rust/kernel/driver.rs:82:28
> |
> 82 | //! [`auxiliary::Driver`]: kernel::auxiliary::Driver
> | ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `auxiliary` in module `kernel`
>
> Fix this by making the documentation for these examples conditional on
> the corresponding configuration options.
>
> Fixes: 970a7c68788e ("driver: rust: expand documentation for driver infrastructure")
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Closes: https://lore.kernel.org/rust-for-linux/20251209.151817.744108529426448097.fujita.tomonori@gmail.com/
Tomo: do you want to send the other cases in your diff as a patch? Thanks!
This patch, together with Tomo's diff, will likely clean UML in 6.18.y
as well (Cc'ing David).
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: driver: fix broken intra-doc links to example driver types
2025-12-27 15:47 [PATCH] rust: driver: fix broken intra-doc links to example driver types Alice Ryhl
2025-12-30 21:18 ` Miguel Ojeda
@ 2025-12-30 22:32 ` Danilo Krummrich
1 sibling, 0 replies; 4+ messages in thread
From: Danilo Krummrich @ 2025-12-30 22:32 UTC (permalink / raw)
To: Alice Ryhl
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Miguel Ojeda, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Alexandre Courbot, rust-for-linux,
linux-kernel
On Sat Dec 27, 2025 at 4:47 PM CET, Alice Ryhl wrote:
> The `auxiliary` and `pci` modules are conditional on
> `CONFIG_AUXILIARY_BUS` and `CONFIG_PCI` respectively. When these are
> disabled, the intra-doc links to `auxiliary::Driver` and `pci::Driver`
> break, causing rustdoc warnings (or errors with `-D warnings`).
>
> error: unresolved link to `kernel::auxiliary::Driver`
> --> rust/kernel/driver.rs:82:28
> |
> 82 | //! [`auxiliary::Driver`]: kernel::auxiliary::Driver
> | ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `auxiliary` in module `kernel`
>
> Fix this by making the documentation for these examples conditional on
> the corresponding configuration options.
>
> Fixes: 970a7c68788e ("driver: rust: expand documentation for driver infrastructure")
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Applied to driver-core-linus, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rust: driver: fix broken intra-doc links to example driver types
2025-12-30 21:18 ` Miguel Ojeda
@ 2025-12-30 22:59 ` Alice Ryhl
0 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-12-30 22:59 UTC (permalink / raw)
To: Miguel Ojeda
Cc: FUJITA Tomonori, Danilo Krummrich, Greg Kroah-Hartman,
Rafael J. Wysocki, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Daniel Almeida, Alexandre Courbot, rust-for-linux,
linux-kernel, David Gow
On Tue, Dec 30, 2025 at 10:18 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Sat, Dec 27, 2025 at 4:47 PM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > The `auxiliary` and `pci` modules are conditional on
> > `CONFIG_AUXILIARY_BUS` and `CONFIG_PCI` respectively. When these are
> > disabled, the intra-doc links to `auxiliary::Driver` and `pci::Driver`
> > break, causing rustdoc warnings (or errors with `-D warnings`).
> >
> > error: unresolved link to `kernel::auxiliary::Driver`
> > --> rust/kernel/driver.rs:82:28
> > |
> > 82 | //! [`auxiliary::Driver`]: kernel::auxiliary::Driver
> > | ^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `auxiliary` in module `kernel`
> >
> > Fix this by making the documentation for these examples conditional on
> > the corresponding configuration options.
> >
> > Fixes: 970a7c68788e ("driver: rust: expand documentation for driver infrastructure")
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>
> Reported-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> Closes: https://lore.kernel.org/rust-for-linux/20251209.151817.744108529426448097.fujita.tomonori@gmail.com/
>
> Tomo: do you want to send the other cases in your diff as a patch? Thanks!
>
> This patch, together with Tomo's diff, will likely clean UML in 6.18.y
> as well (Cc'ing David).
Ah, I thought I had seen someone else run into this somewhere, but I
couldn't find it. Thanks for digging it up!
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-30 22:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-27 15:47 [PATCH] rust: driver: fix broken intra-doc links to example driver types Alice Ryhl
2025-12-30 21:18 ` Miguel Ojeda
2025-12-30 22:59 ` Alice Ryhl
2025-12-30 22:32 ` Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox