Re: [RESEND 1/4] mfd: altera-sysmgr: Add SOCFPGA System Manager abstraction

From: Arnd Bergmann
Date: Tue Dec 18 2018 - 10:25:05 EST


On Tue, Dec 18, 2018 at 12:21 AM Thor Thayer
<thor.thayer@xxxxxxxxxxxxxxx> wrote:
>
> Hi Arnd,
>
> On 12/14/18 6:36 AM, Arnd Bergmann wrote:
> > On Tue, Nov 13, 2018 at 5:03 PM <thor.thayer@xxxxxxxxxxxxxxx> wrote:
> >>
> >> From: Thor Thayer <thor.thayer@xxxxxxxxxxxxxxx>

> >> +static int socfpga_is_s10(void)
> >> +{
> >> + return of_machine_is_compatible("altr,socfpga-stratix10");
> >> +}
> >
> > I don't really like the way you are checking for a specific here
> > here though, that is something that should only be done in
> > an absolute emergency when there is no way of fixing the
> > device tree files.
> >
> > Since this is a new driver for a device that is not used in
> > mainline kernels yet (AFAICT), let's fix the binding and add
> > a proper detection method here.
> >
> Thank you. I'm not completely clear on this. Are you saying this
> function should test for a new compatible that is assigned to Stratix10
> in the binding ("altr,sys-mgr-s10") instead of the machine name?

Yes, exactly.

Arnd