Re: [PATCH v2] dt-bindings: fpga: Convert fpga-region binding to yaml

From: Krzysztof Kozlowski
Date: Wed Jan 17 2024 - 03:14:39 EST


On 17/01/2024 09:07, Michal Simek wrote:
>>> +patternProperties:
>>> + "@(0|[1-9a-f][0-9a-f]*)$":
>>> + type: object
>>
>> You put (0|[...) to disallow @0001? I personally would not care, dtc
>> handles this, and the pattern is confusing. Just @[0-9a-z]+$
>
> This is actually taken from dtschema/schemas/simple-bus.yaml to allow all nodes
> with regs.
>
>>
>>> +
>>> + "^[^@]+$": true
>>
>> I dislike it. How is this binding supposed to be used? If in standalone
>> way, then you allow any property so what's the point of this schema? If
>> fpga-bridge.yaml is referenced by other device-specific binding, then
>> all properties will be evaluated here, so the same: you allow any property.
>>
>> Depending on the usage, this might be just like other generic, common
>> schemas, so end with "additionalPropeties: true".
>
> ok. I am fine with it.

But please verify my idea. If it is used standalone, then you should
drop both above patterns + additionalProps:false. If it is used as
generic schema referenced by something, then you could keep one pattern
for object, but actually it is redundant, so I propose to drop them and
additionalProps:true.

Best regards,
Krzysztof