Skip to content

Commit

Permalink
MIPS: dts: Remove leading 0x and 0s from bindings notation
Browse files Browse the repository at this point in the history
Improve the DTS files by removing all the leading "0x" and zeros to fix
the following dtc warnings:

Warning (unit_address_format): Node /XXX unit name should not have leading "0x"

and

Warning (unit_address_format): Node /XXX unit name should not have leading 0s

Converted using the following command:

find . -type f \( -iname *.dts -o -iname *.dtsi \) -exec sed -E -i -e "s/@0x([0-9a-fA-F\.]+)\s?\{/@\L\1 \{/g" -e "s/@0+([0-9a-fA-F\.]+)\s?\{/@\L\1 \{/g" {} +

For simplicity, two sed expressions were used to solve each warnings
separately.

To make the regex expression more robust a few other issues were
resolved, namely setting unit-address to lower case, and adding a
whitespace before the the opening curly brace:

https://elinux.org/Device_Tree_Linux#Linux_conventions

This is a follow up to commit 4c9847b ("dt-bindings: Remove leading
0x from bindings notation")

Reported-by: David Daney <ddaney@caviumnetworks.com>
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Cc: linux-mips@linux-mips.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/18528/
Signed-off-by: James Hogan <jhogan@kernel.org>
  • Loading branch information
Mathieu Malaterre authored and James Hogan committed Feb 19, 2018
1 parent 21cff2d commit c768519
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/mips/boot/dts/img/boston.dts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
#address-cells = <1>;
#size-cells = <0>;

rtc@0x68 {
rtc@68 {
compatible = "st,m41t81s";
reg = <0x68>;
};
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/boot/dts/ingenic/ci20.dts
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,22 @@
reg = <0x0 0x0 0x0 0x800000>;
};

partition@0x800000 {
partition@800000 {
label = "u-boot";
reg = <0x0 0x800000 0x0 0x200000>;
};

partition@0xa00000 {
partition@a00000 {
label = "u-boot-env";
reg = <0x0 0xa00000 0x0 0x200000>;
};

partition@0xc00000 {
partition@c00000 {
label = "boot";
reg = <0x0 0xc00000 0x0 0x4000000>;
};

partition@0x8c00000 {
partition@8c00000 {
label = "system";
reg = <0x0 0x4c00000 0x1 0xfb400000>;
};
Expand Down

0 comments on commit c768519

Please sign in to comment.