Re: [PATCH v6 3/7] rust: clk: use the type-state pattern

From: Alice Ryhl

Date: Wed Nov 18 2026 - 08:48:36 EST


On Tue, Oct 13, 2026 at 02:07:42PM -0300, Daniel Almeida wrote:
> + /// Drivers that need to change a clock's state at runtime (for example to
> + /// enable it on resume and disable it on suspend) can keep it in an enum
> + /// and move between the variants:
> + ///
> + /// ```
> + /// use kernel::clk::{Clk, Enabled, Prepared};
> + /// use kernel::error::Result;
> + ///
> + /// enum DeviceClk {
> + /// Suspended(Clk<Prepared>),
> + /// Resumed(Clk<Enabled>),
> + /// }

Nit: looks like this doctest missed the vertical import style from patch 1
(and `Result` is already in the prelude).

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

Alice