Re: [PATCH v4 2/3] rust: platform: wire runtime PM callbacks

From: Alice Ryhl

Date: Fri Oct 16 2026 - 08:13:01 EST


On Mon, Oct 05, 2026 at 03:37:40PM +0200, Beata Michalska wrote:
> @@ -223,6 +225,14 @@ pub trait Driver {
> /// The table of ACPI device ids supported by the driver.
> const ACPI_ID_TABLE: Option<acpi::IdTable<Self::IdInfo>> = None;
>
> + /// Provides driver's PM callbacks, if any.
> + fn dev_pm_ops() -> Option<crate::pm::DevPMOpsRef<'static, Adapter<Self>>>
> + where
> + Self: Sized,
> + {
> + None
> + }

Since `DevPMOps::pm_ops()` is a `const fn`, can this be an associated constant
`const DEV_PM_OPS: Option<crate::pm::DevPMOpsRef<'static, Adapter<Self>>> = None;`
to match `OF_ID_TABLE` and `ACPI_ID_TABLE` right above it?

Alice