Re: [PATCH v2 04/15] ARM: milbeaut: Add basic support for Milbeaut m10v SoC

From: Arnd Bergmann
Date: Tue Feb 19 2019 - 04:21:21 EST


On Tue, Feb 19, 2019 at 8:12 AM Sugaya, Taichi
<sugaya.taichi@xxxxxxxxxxxxx> wrote:
> On 2019/02/18 21:15, Arnd Bergmann wrote:
> > On Fri, Feb 8, 2019 at 1:26 PM Sugaya Taichi
> > <sugaya.taichi@xxxxxxxxxxxxx> wrote:
>
> >> +static int __init m10v_pm_init(void)
> >> +{
> >> + suspend_set_ops(&m10v_pm_ops);
> >> +
> >> + return 0;
> >> +}
> >> +late_initcall(m10v_pm_init);
> >
> > This requires a check to ensure you are actually on the right platform,
> > otherwise you break suspend/resume in a multiplatform kernel running
> > on anything other than milbeaut.
> >
>
> OK.
> I think the solution is adding a "if statement with mlbeaut compatible"
> above suspend_set_ops(&m10v_pm_ops).

Right, you can either use a call to of_machine_is_compatible(),
or you add a machine descriptor with OF_MACHINE_START()
and use this as the init_late() callback.

Arnd