[PATCH 07/10] dt-bindings: mtd: Ensure partition node properties are documented

Rob Herring robh at kernel.org
Wed Jan 14 09:47:06 PST 2026


On Wed, Jan 14, 2026 at 7:58 AM Miquel Raynal <miquel.raynal at bootlin.com> wrote:
>
> Hi Rob,
>
> >> > +$defs:
> >> > +  partition-node:
> >> > +    type: object
> >> > +    if:
> >> > +      not:
> >> > +        required: [ compatible ]
> >> > +    then:
> >> > +      $ref: '#'
> >> > +      unevaluatedProperties: false
> >> > +    else:
> >> > +      $ref: '#'
> >>
> >> This, however, is total blackmagic to me. Would you mind explaining what
> >>
> >>       $ref: '#'
> >>
> >> indicates? Is this a placeholder indicating "a reference must be given?
> >
> > It's what's known as JSON pointers. The '#' is a reference to the top
> > level of this schema.
> >
> >> Also I do not understand the final else case, what is it covering?
> >
> > It's really just there so a $ref to
> > partition.yaml#/$defs/partition-node applies the schema (all of
> > partition.yaml) whether there's a compatible property or not.
> >
> > This all just works around that a schema like this doesn't work:
> >
> > $ref: foo.yaml
> > if:
> >   ...
> > then:
> >   unevaluatedProperties: false
> >
> > The evaluation of unevaluatedProperties doesn't "see" the $ref being
> > in the parent. So we can't factor out the $ref.
>
> Oooh, ok, fully understood. I think I already faced that problem
> before. First time I hear about JSON pointers, thanks a lot for the
> heads up.
>
> Regarding this series, it feels like in the end, if I understood the
> discussion with Krzysztof correctly, there is no modification to bring?
> Let me know if you plan on sending a v2 of if I shall take v1 otherwise.

Right, I think v1 is good to go.

Rob



More information about the linux-mtd mailing list