Re: [PATCH 5/5] dt-bindings: iio: adc: xilinx-xadc: convert to YAML format
From: Krzysztof Kozlowski
Date: Sun Mar 22 2026 - 05:55:39 EST
On 19/03/2026 20:07, David Lechner wrote:
> On 3/19/26 11:49 AM, Krzysztof Kozlowski wrote:
>> On 19/03/2026 16:49, Sai Krishna Potthuri wrote:
>>>>>>>>>>
>>>>>>>>>>> +
>>>>>>>>>>> +$defs:
>>>>>>>>>>
>>>>>>>>>> Why this is a def, not used directly? I see only one usage of this def.
>>>>>>>>>
>>>>>>>>> I am getting the below error if i define the patternProperties directly.
>>>>>>>>> Seems like complex vendor peroperties should be referenced via $ref.
>>>>>>>>> Please suggest if there is any better way to deal this.
>>>>>>>>
>>>>>>>> It is hard to say without seeing the new version of what you wrote.
>>>>>>>
>>>>>>> In v1 series, i created $def and referenced this in xlnx,channels to avoid the error that i mentioned.
>>>>>>
>>>>>> Is the code below the code that causes the error?
>>>>>
>>>>> No, the below code is not creating the error but Krzysztof asked the question on this code,
>>>>> "Why this is a def, not used directly? I see only one usage of this def."
>>>>>
>>>>> I am saying if i don't use the def and use it directly i am seeing the error that i mentioned. So, asking is there any better way to handle this case other than using def.
>>>>
>>>> If you could show us the actual code that is causing the error, then
>>>> we could perhaps spot a mistake or suggest an alternative.
>>
>> Thanks David, I am surprised how many emails we need to exchange just to
>> see the actual code.
>>
>>>
>>> Thanks. Here is the code that is causing the error
>>> ("properties:xlnx,channels:type: 'boolean' was expected").
>>>
>>> xlnx,channels:
>>
>> Device nodes do not have any prefixes. Just take a look at any DTS or
>> any binding.
>>
>> Probably that's the reason, because nothing in this code looks
>> particularly odd. Anyway, please do not come with odd syntax in the code
>> without any explanation, just to make it passing the tests, so for
>> example ignoring the checks we have.
>>
>>
>> Best regards,
>> Krzysztof
>
> Since this is converting existing 12-years-old .txt bindings, I don't
> think we can "fix" the bindings by dropping the vendor prefix.
Indeed. It is being also in the driver. The prefix must stay and this
oddity must be explained in the commit msg.
Commit msg must explain all the non-obvious, unusual, unexpected odd
things the patch is doing.
>
> I think in cases like this, Rob will usually fix the tooling to ignore
> this as a special case. (I had a similar case last year on a conversion
> I did.)
>
> So I think the right thing to do is to not use $def and explain in the
> commit message why the error is expected (we can't change existing bindings
> even though they are "wrong" by current standards).
>
> If this was a new binding, we should be using the common adc.yaml for IIO
> ADCs which already has patterProperties for channels and a bipolar flag.
> But we are stuck with this vendor-prefixed one here.
>
Best regards,
Krzysztof