-
Notifications
You must be signed in to change notification settings - Fork 7.8k
ST DTS lint #90611
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
base: main
Are you sure you want to change the base?
ST DTS lint #90611
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.
Indeed these changes are recommended.
A few review comments.
@@ -117,6 +117,7 @@ arduino_i2c: &i2c1 {}; | |||
&spi1_miso_pa6 &spi1_mosi_pa7>; | |||
pinctrl-names = "default"; | |||
status = "okay"; | |||
|
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.
from the specs, I guess we should rather have:
pinctrl-names = "default";
+ cs-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
status = "okay";
- cs-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
lora: lora@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.
This exists in a bunch of places. I think it falls into the category of splitting into paragraphs for readabillity. It's nice to have the cs-gpios
right before the spi device sub-nodes because they go together logically
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.
I must say I don't understand why you don't want to change this while still change other status
properties placement.
(2 other occurrences).
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.
Did I fix all the inconsistancies?
@@ -170,6 +170,7 @@ | |||
pinctrl-0 = <&spi2_sck_pd1 &spi2_miso_pd3 &spi2_mosi_pc3>; | |||
pinctrl-names = "default"; | |||
status = "okay"; | |||
|
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.
pinctrl-names = "default";
+ cs-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>;
status = "okay";
- cs-gpios = <&gpiod 0 GPIO_ACTIVE_LOW>;
spbtle_1s_sensortile_box: spbtle-1s@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.
same
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.
I still believe, if following the recommendation, that cs-gpios = ...
should come before status = ...
.
@etienne-lms All good? |
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.
Aside the 3 comments below, the changes here are consistent.
(edited) the 3 comments are here, here and here.
@erwango, what do you think about such changes?
The DTS spec talks about a "preferred" order that is addressed in these changes (in https://docs.kernel.org/devicetree/bindings/dts-coding-style.html#order-of-properties-in-device-node). It's not a strong recommendation.
The following order of properties in device nodes is preferred:
- “compatible”
- “reg”
- “ranges”
- Standard/common properties (defined by common bindings, e.g. without vendor-prefixes)
- Vendor-specific properties
- “status” (if applicable)
- Child nodes, where each node is preceded with a blank line
There are a few changes in this P-R that I'm fully in favor of: rules 7. (sub nodes always after properties). As for the other, I'm not sure. That said, I must admit that always expecting the status
property at this end is simpler, to know whether it's present or not, especially in case there are a lot of properties.
@@ -117,6 +117,7 @@ arduino_i2c: &i2c1 {}; | |||
&spi1_miso_pa6 &spi1_mosi_pa7>; | |||
pinctrl-names = "default"; | |||
status = "okay"; | |||
|
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.
I must say I don't understand why you don't want to change this while still change other status
properties placement.
(2 other occurrences).
|
||
mx25lm51245: ospi-nor-flash@90000000 { | ||
status = "okay"; |
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.
Equivalent change in boards/st/stm32l562e_dk/stm32l562e_dk_common.dtsi is missing.
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.
Missed it. Will fix
According to the guidelines the `reg` property should always come before any other property other than `compatible`. Link: https://docs.kernel.org/devicetree/bindings/dts-coding-style.html Signed-off-by: Yishai Jaffe <[email protected]>
According to the guidelines the `status` property should always be the last property listed. Link: https://docs.kernel.org/devicetree/bindings/dts-coding-style.html Signed-off-by: Yishai Jaffe <[email protected]>
|
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 effort and care provided to these files.
This being said, I'm a bit concerned by the spread of the change and:
- the probability it will create churn to anyone that has PR/branch/patch on those files
- the fact that this change is only a one time thing and will be hard to maintain (one going and next PR should be reviewed with the same requirements) and not enforced by linting script/checker, so won't be likely enforced in future
- applied only on part of the files (st boards), so most probably, contamination from other areas will happen some day.
For all these reasons, I'd suggest to drop 2 parts to minimize the spread of the change:
- status moves
- label moves
I hope you understand my concern.
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
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.
I'm still not sure the recommendations on status
and label
properties ordering in nodes really need to be strictly followed. That said, these changes almost look good to me, see my few remaining review comments.
reg = <0x0 DT_SIZE_K(64)>; | ||
label = "mcuboot"; |
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.
This change belongs to previous commit "boards: st: change order of reg property in partitions."
Ditto for changes around lines 241, 253, 261 and 269.
@@ -170,6 +170,7 @@ | |||
pinctrl-0 = <&spi2_sck_pd1 &spi2_miso_pd3 &spi2_mosi_pc3>; | |||
pinctrl-names = "default"; | |||
status = "okay"; | |||
|
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.
I still believe, if following the recommendation, that cs-gpios = ...
should come before status = ...
.
status = "okay"; | ||
|
||
cs-gpios = <&gpioa 2 GPIO_ACTIVE_LOW>; |
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.
I still believe, if following the recommendation, that cs-gpios = ...
should come before status = ...
.
@@ -234,7 +234,6 @@ stm32_lp_tick_source: &lptim1 { | |||
spi-bus-width = <OSPI_OPI_MODE>; | |||
data-rate = <OSPI_DTR_TRANSFER>; | |||
four-byte-opcodes; | |||
status = "okay"; |
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.
status = "okay"
is missing below sfdp-bfp
property.
Fixed two issues according to the device tree guidelines https://docs.kernel.org/devicetree/bindings/dts-coding-style.html:
reg
property should be second only to thecompatible
property within a node. This was not the case in many partition nodes definitions.status
property should be the last property in a node.