Re: [PATCH v2 2/8] dt-bindings: PCI: renesas-pci-usb: Convert bindings to json-schema

Herve Codina
2022-04-20T13:46:23Z

Hi Rob,

On Wed, 20 Apr 2022 08:18:50 -0500
Rob Herring <robh@kernel.org> wrote:

...

> > > > + bus-range:
> > > > + description: |
> > > > + The PCI bus number range; as this is a single bus, the range
> > > > + should be specified as the same value twice.
> > >
> > > items:
> > > const: 0
> >
> > Well, some other values are present in some dtsi files such as
> > 'bus_range = <1 1>;' or 'bus_range = <2 2>;' in r8a7742.dtsi.
> >
> > The constraint is to have the same value twice. Is there a way
> > to specify this constraint ?
>
> Yes, but probably not worthwhile. Just drop it as pci-bus.yaml already
> defines it.

Instead of fully dropping the property, don't you think that keeping
the given description here can be a way to express that the same value
is needed twice ?

>
> > > > +
> > > > + "#address-cells":
> > > > + const: 3
> > > > +
> > > > + "#size-cells":
> > > > + const: 2
> > > > +
> > > > + "#interrupt-cells":
> > > > + const: 1
> > >
> > > All these are defined by pci-bus.yaml
> >
> > Right.
> > Replaced by:
> >
> > "#address-cells": true
> > "#size-cells": true
> > "#interrupt-cells": true
> >
> > Is that correct ?
>
> You can just drop them completely.

Ok for #address-cells and #size-cells but not for #interrupt-cells.

Dropping #interrupt-cells makes 'make dtbindings_check' unhappy:
--- 8< ---
$ make dt_binding_check DT_SCHEMA_FILES=renesas,pci-rcar-gen2.yaml
LINT Documentation/devicetree/bindings
CHKDT Documentation/devicetree/bindings/processed-schema.json
/home/hcodina/xxx/Documentation/devicetree/bindings/pci/renesas,pci-rcar-gen2.yaml: properties: '#interrupt-cells' is a dependency of 'interrupt-map'
from schema $id: http://devicetree.org/meta-schemas/interrupts.yaml#
SCHEMA Documentation/devicetree/bindings/processed-schema.json
/home/hcodina/xxx/Documentation/devicetree/bindings/pci/renesas,pci-rcar-gen2.yaml: ignoring, error in schema: properties
DTEX Documentation/devicetree/bindings/pci/renesas,pci-rcar-gen2.example.dts
DTC Documentation/devicetree/bindings/pci/renesas,pci-rcar-gen2.example.dtb
CHECK Documentation/devicetree/bindings/pci/renesas,pci-rcar-gen2.example.dtb
$
--- 8< ---

So I keep
"#interrupt-cells": true

Regards,
Hervé

--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering