Re: [PATCH] spi: dt-bindings: spi-controller: Fix #address-cells for slave mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Maxime,

On Thu, Feb 27, 2020 at 2:51 PM Maxime Ripard <maxime@xxxxxxxxxx> wrote:
> On Thu, Feb 27, 2020 at 02:19:08PM +0100, Geert Uytterhoeven wrote:
> > On Thu, Feb 27, 2020 at 2:09 PM Maxime Ripard <maxime@xxxxxxxxxx> wrote:
> > > On Thu, Feb 27, 2020 at 02:03:23PM +0100, Geert Uytterhoeven wrote:
> > > > Currently, the DT bindings for an SPI controller specify that
> > > > "#address-cells" must be fixed to one.  However, that applies to an SPI
> > > > controller in master mode only.  When running in SPI slave mode,
> > > > "#address-cells" should be zero.
> > > >
> > > > Fix this making the value of "#address-cells" dependent on the presence
> > > > of "spi-slave".
> > > >
> > > > Fixes: 0a1b929356830257 ("spi: Add YAML schemas for the generic SPI options")
> > > > Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> >
> > > > --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
> > > > +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
> >
> > > > @@ -52,6 +53,18 @@ properties:
> > > >      description:
> > > >        The SPI controller acts as a slave, instead of a master.
> > > >
> > > > +if:
> > > > +  required:
> > > > +    [ spi-slave ]
> > >
> > > Nit: Usually, that notation is when you would do it on the same line,
> > > if you want to go to a new line, it would make more sense to use -
> >
> > Sorry, being a poor yaml-by-example programmer, I don't understand what
> > you mean.  Which part do you refer to by "that notation"?
>
> I meant that usually the [] notation is used over a single line.
>
> If you want to have a list over multiple lines, usually you would have
>
> required:
>   - spi-slave

IC. So I can also write:

    if:
      required: [ spi-slave ]
    else:
      ...

which is even shorter ;-)

Both seem to work fine.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux