Re: Aw: Re: [RFC v2] dt-bindings: net: dsa: convert binding for mediatek switches

From: Frank Wunderlich
Date: Fri May 06 2022 - 10:09:07 EST


Am 6. Mai 2022 09:15:12 MESZ schrieb Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>:
>On 06/05/2022 08:46, Frank Wunderlich wrote:
>>>> + const: 1
>>>> +
>>>> + "#size-cells":
>>>> + const: 0
>>>> +
>>>> + core-supply:
>>>> + description: |
>>>
>>> Drop | everywhere where it is not needed (so in all places, AFAICT)
>>
>> is it necessary for multiline-descriptions or is indentation enough?
>
>It's necessary only when YAML syntax characters appear in description
>or
>when you want specific formatting.
>
>https://elixir.bootlin.com/linux/v5.18-rc5/source/Documentation/devicetree/bindings/example-schema.yaml#L97
>
>https://yaml-multiline.info/

Ok then i drop all except on examples

>>>> +
>>>> +patternProperties:
>>>
>>> patternProperties go before allOf, just after regular properties.
>>
>> after required, right?
>
>properties do not go after required, so neither patternProperties
>should. Something like: propertes -> patternProperties -> dependencies
>-> required -> allOf -> additionalProperties -> examples

Thx for explanation

So i end up like this:

https://github.com/frank-w/BPI-R2-4.14/blob/5.18-mt7531-mainline/Documentation/devicetree/bindings/net/dsa/mediatek%2Cmt7530.yaml

Including followup (remove reset-gpios and add rgmii for mt7531).

>>
>>>> + "^(ethernet-)?ports$":
>>>> + type: object
>>>
>>> Also on this level:
>>> unevaluatedProperties: false
>>
>> this is imho a bit redundant because in dsa.yaml (which is included
>now after patternProperties)
>> it is already set on both levels.
>
>dsa.yaml does not set it on ethernet-ports.
>
>> Adding it here will fail in examples because of size/address-cells
>which are already defined in dsa.yaml...
>> so i need to define them here again.
>
>You're right, it cannot be set here.

So i make no change here,right?

>Best regards,
>Krzysztof


regards Frank