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

From: Alice Ryhl

Date: Mon Oct 19 2026 - 09:10:16 EST


On Mon, Oct 19, 2026 at 2:19 PM Beata Michalska <beata.michalska@xxxxxxx> wrote:
>
> On Fri, Oct 16, 2026 at 12:12:30PM +0000, Alice Ryhl wrote:
> > 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?
> >
> It can, as long as no one would mind making the Driver trait sized.

That seems fine to me

Alice