-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phandle-array doesn't allow array of just phandles #28709
Comments
How about |
Same error (tested in a different keymap with a slightly different array):
|
zephyr/dts/binding-template.yaml Lines 157 to 160 in 0a0cb52
´(possibly)´ should possibly replaced or removed. |
I'll admit I am still very unfamiliar with DT, but I'm confused as to why edtlib.py allows phandle-array to be either Having phandles with no associated numbers seems to work as long as there is at least one number somewhere in the array. If phandle-array allows any element to be a phandle with no associated number, why is it not valid for the entire array to be made of such elements? If that is not valid, then should phandle-array require every phandle to have at least one associated number? I don't know if DT was intended to be used like this, but one of the ways it is used in ZMK is to define a mapping between keyboard keys and the behaviors to use when each key is pressed. Some behaviors such as |
You are right, the error check seems too strict for the degenerated case that you describe. Line 1229 in adb62ea
I could not find In my view TYPE_PHANDLES should be added to the allowed dtslib types for |
Yep. See https://github.com/zmkfirmware/zmk/blob/main/app/dts/behaviors/none.dtsi for example. Should |
Yes. Looking at Lines 1353 to 1357 in 1342d12
|
Agreed; I'll send a PR |
Each controller node in a phandle-array may set the number of cells in a specifier as any nonnegative integer. Currently, we don't allow this in edtlib in the case where there are multiple controllers in a phandle-array property all of which have 0 cells in the relevant specifier, which is not correct. Fix this, add a regression test, and improve the error message while we are here. Fixes: zephyrproject-rtos#28709 Signed-off-by: Martí Bolívar <[email protected]>
Each controller node in a phandle-array may set the number of cells in a specifier as any nonnegative integer. Currently, we don't allow this in edtlib in the case where there are multiple controllers in a phandle-array property all of which have 0 cells in the relevant specifier, which is not correct. Fix this, add a regression test, and improve the error message while we are here. Fixes: #28709 Signed-off-by: Martí Bolívar <[email protected]>
Describe the bug
zephyr/dts/binding-template.yaml
Lines 157 to 160 in 0a0cb52
<&foo &bar>
should be valid.However,
zephyr/scripts/dts/edtlib.py
Lines 1225 to 1230 in 0a0cb52
TYPE_PHANDLE
(a single phandle) andTYPE_PHANDLES_AND_NUMS
. Is that supposed to beTYPE_PHANDLES
instead ofTYPE_PHANDLE
?To Reproduce
Steps to reproduce the behavior:
app/boards/shields/romac/romac.keymap
and change one of thebindings
arrays to contain only values such as&reset
and&trans
so there are no numbers in the array.This will fail with an error like
Expected behavior
As far as I can tell, an array of just phandles should be valid for a phandle-array.
Impact
Annoyance. Can be worked around by adding something that uses numbers somewhere in the array.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: