-
Notifications
You must be signed in to change notification settings - Fork 7.4k
boards: silabs: fix boards DTS files coding style issues #90607
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for taking the initative to clean things up! I only have some comments/questions when it comes to pinctrl nodes specifically.
@@ -7,44 +7,46 @@ | |||
#include <dt-bindings/pinctrl/silabs/xg22-pinctrl.h> | |||
|
|||
&pinctrl { | |||
usart0_default: usart0_default { | |||
itm_default: itm_default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the style guidelines:
Use dashes (-) as word separators for node and property names.
Use underscores (_) as word separators in node labels.
This suggests that this should be itm_default: itm-default {
. However, that doesn't match with any of the examples in the Pin Control documentation at https://docs.zephyrproject.org/latest/hardware/pinctrl/index.html.
The same documentation also consistently lists the pin selections before the properties that apply to the pins. IMO, it's more readable to consistently have the pin list come as the first child of the pinctrl node and for any pin properties to come after it, rather than having the pin list as a random node in the middle of the properties. But if this is consistent with how the project wants it, I'm not going to protest.
@gmarull @mbolivar As maintainers of pinctrl and devicetree respectively, what are your thoughts on this?
I feel many people try to go from the most generic attributes to the most specific (with an exception for That's said, this is not a big deal. |
4f99c68
to
89c63ce
Compare
Reverted the Regarding the |
That makes some sense but unfortunately that's not what the guidelines say so I think that precedes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the sgrm.dts improvements. Did not check the other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a couple of minor inconsistencies, but that shouldn't block the big improvements for everything else.
pinctrl-0 = <&eusart1_default>; | ||
pinctrl-names = "default"; | ||
cs-gpios = <&gpioc 0 GPIO_ACTIVE_LOW>; | ||
clock-frequency = <4000000>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this one was missed, other #-prefixed properties have been sorted first (using the #
rather than the s
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. My bad
height = <128>; | ||
spi-max-frequency = <DT_FREQ_M(2)>; | ||
width = <128>; | ||
extcomin-gpios = <&gpiod 2 GPIO_ACTIVE_HIGH>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line before section or these should come before height
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the guidelines, vendor specific properties like these come last.
Fix board DTS coding style issues to prevent them from spreading when a new board is introduced and uses an existing DTS as a referance. Issues addressed from Zephyr devicetree style guidelines [1]: - Don’t insert empty lines before a deindenting };. - Insert a single empty line to separate nodes at the same hierarchy level. - status is "okay" by default. - compatible property comes first in node. - reg property comes second in node. - status property comes last in node. - the rest of the properties within are nodes naturally sorted. - child nodes are sorted by address or alphabetically if there is no address. No functional change. Link: https://docs.zephyrproject.org/latest/contribute/style/devicetree.html [1] Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
6cfbdb2
89c63ce
to
6cfbdb2
Compare
|
Fix board DTS coding style issues to prevent them from spreading when a new board is introduced and uses an existing DTS as a referance.
Issues addressed from Zephyr devicetree style guidelines [1]:
No functional change.
Link: https://docs.zephyrproject.org/latest/contribute/style/devicetree.html [1]
Took inspiration from #90312