Re: [U-Boot] [PATCH v3 104/108] x86: apollolake: Add P2SB driver

2019-10-21 Thread Simon Glass
Hi Andy,

On Mon, 21 Oct 2019 at 02:49, Andy Shevchenko  wrote:
>
> On Mon, Oct 21, 2019 at 7:14 AM Simon Glass  wrote:
> >
> > Adds a driver for the apollolake Primary-to-sideband bus. This supports
> > various child devices. It supposed both device tree and of-platdata.
>
> > +static int apl_p2sb_probe(struct udevice *dev)
> > +{
> > +   if (spl_phase() == PHASE_TPL)
> > +   return apl_p2sb_early_init(dev);
>
> > +   else if (spl_phase() == PHASE_SPL)
>
> Redundant 'else' (recommended to check for a such in the entire series)

This is a style thing. I like the else so that it is clear that we
have two options. I could use a switch() but then it needs to have a
'default' which is ugly.
>
> > +   return apl_p2sb_spl_init(dev);
> > +
> > +   return 0;
> > +}

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 104/108] x86: apollolake: Add P2SB driver

2019-10-21 Thread Andy Shevchenko
On Mon, Oct 21, 2019 at 7:14 AM Simon Glass  wrote:
>
> Adds a driver for the apollolake Primary-to-sideband bus. This supports
> various child devices. It supposed both device tree and of-platdata.

> +static int apl_p2sb_probe(struct udevice *dev)
> +{
> +   if (spl_phase() == PHASE_TPL)
> +   return apl_p2sb_early_init(dev);

> +   else if (spl_phase() == PHASE_SPL)

Redundant 'else' (recommended to check for a such in the entire series)

> +   return apl_p2sb_spl_init(dev);
> +
> +   return 0;
> +}

-- 
With Best Regards,
Andy Shevchenko
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot