Re: [PATCH] dt-bindings: nvmem: sprd-efuse: convert to YAML

From: Krzysztof Kozlowski
Date: Mon Jul 15 2024 - 03:15:39 EST


On 14/07/2024 13:10, Stanislav Jakubek wrote:
> On Sat, Jul 13, 2024 at 08:31:31PM +0200, Krzysztof Kozlowski wrote:
>> On 13/07/2024 14:12, Stanislav Jakubek wrote:
>
> [snip]
>
>>> +allOf:
>>> + - $ref: nvmem.yaml#
>>> + - $ref: nvmem-deprecated-cells.yaml#
>>> + - if:
>>> + properties:
>>> + compatible:
>>> + contains:
>>> + const: sprd,ums312-efuse
>>> + then:
>>> + required:
>>> + - clocks
>>> + - clock-names
>>> + else:
>>> + properties:
>>> + clocks: false
>>> + clock-names: false
>>
>> Half of the binding is this "if:", so I would say they are not that
>> similar. I think it would be easier to read them if these were split
>> into two bindings.
>>
>> Best regards,
>> Krzysztof
>>
>
> Hi Krzysztof,
>
> pretty much this exact if-then-else is described in the "Writing Devicetree
> Bindings in json-schema" documentation as a "typical case" for its usage, so
> I went with that. I think that it's simple enough that it only minimally
> hampers readability.

Example schema has a lot of stuff shown, because it is example...

>
> I admit that there might be some confusion, since I forgot to include an
> example for the sprd,ums312-efuse (i.e. with clocks and clock-names).
> Could I just add this example in V2 and keep it as-is otherwise?

Usually one example per binding is enough, if devices differ by one
property.


Best regards,
Krzysztof