ARM: dts: exynos: override GPIO keys node by label in Exynos4412 Odroid family
authorKrzysztof Kozlowski <krzk@kernel.org>
Tue, 27 Oct 2020 17:09:38 +0000 (18:09 +0100)
committerKrzysztof Kozlowski <krzk@kernel.org>
Wed, 28 Oct 2020 21:46:25 +0000 (22:46 +0100)
Using full paths to extend or override a device tree node is error
prone.  If there was a typo error, a new node will be created instead of
extending the existing node.  This will lead to run-time errors that
could be hard to detect.

A mistyped label on the other hand, will cause a dtc compile error
(during build time).

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20201027170947.132725-4-krzk@kernel.org
arch/arm/boot/dts/exynos4412-odroid-common.dtsi
arch/arm/boot/dts/exynos4412-odroidx.dts

index ab291cec650a9204bc3d6c4293b83823f6e40c29..4c77cd4044f257422da4cfc1ced6ad2c342c7274 100644 (file)
@@ -22,7 +22,7 @@
                reg = <0x0204F000 0x1000>;
        };
 
-       gpio_keys {
+       gpio_keys: gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_power_key>;
index 3ea2a0101e8086f2b8078a4593ee19d2c2540aa1..68fe88074d1dadf2335b6e8bc1d470ac01aaf348 100644 (file)
                };
        };
 
-       gpio_keys {
-               pinctrl-0 = <&gpio_power_key &gpio_home_key>;
-
-               home_key {
-                       gpios = <&gpx2 2 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_HOME>;
-                       label = "home key";
-                       debounce-interval = <10>;
-                       wakeup-source;
-               };
-       };
-
        regulator_p3v3 {
                compatible = "regulator-fixed";
                regulator-name = "p3v3_en";
        phy-names = "hsic0";
 };
 
+&gpio_keys {
+       pinctrl-0 = <&gpio_power_key &gpio_home_key>;
+
+       home-key {
+               gpios = <&gpx2 2 GPIO_ACTIVE_HIGH>;
+               linux,code = <KEY_HOME>;
+               label = "home key";
+               debounce-interval = <10>;
+               wakeup-source;
+       };
+};
+
 &mshc_0 {
        vqmmc-supply = <&buck8_reg>;
 };