Re: [PATCH v6 2/7] rust: clk: replace `OptionalClk` with `Clk::get_optional()`
From: Alice Ryhl
Date: Wed Nov 18 2026 - 08:47:55 EST
On Tue, Oct 13, 2026 at 02:07:41PM -0300, Daniel Almeida wrote:
> + /// Behaves the same as [`Self::get`], except when there is no clock
> + /// producer. In this case, instead of returning [`ENOENT`], it returns
> + /// a dummy [`Clk`].
> + ///
> + /// Equivalent to the kernel's [`clk_get_optional`] API.
> + ///
> + /// [`clk_get_optional`]:
> + /// https://docs.kernel.org/core-api/kernel-api.html#c.clk_get_optional
> + pub fn get_optional(dev: &Device, name: Option<&CStr>) -> Result<Self> {
rustdoc appears broken here (putting the URL on the same line as
`[`clk_get_optional`]:` avoids splitting the link definition).
Otherwise LGTM:
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Alice