treewide: access device tree from userspace via /proc/
authorMathias Kresin <dev@kresin.me>
Wed, 10 May 2017 08:44:18 +0000 (10:44 +0200)
committerMathias Kresin <dev@kresin.me>
Fri, 26 May 2017 06:04:15 +0000 (08:04 +0200)
Access the device tree via /proc/device-tree/ is the documented way to
access the properties. Everything else might not work in future.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/ipq806x/base-files/lib/ipq806x.sh
target/linux/lantiq/base-files/lib/functions/lantiq.sh

index 348a3a89516884a6f8f6a9cccfc5474ab662ddea..2a08a19b80c8b0c24d1017cc39b52536205bb963 100644 (file)
@@ -72,7 +72,7 @@ ipq806x_board_name() {
 ipq806x_get_dt_led() {
        local label
        local ledpath
 ipq806x_get_dt_led() {
        local label
        local ledpath
-       local basepath="/sys/firmware/devicetree/base"
+       local basepath="/proc/device-tree/base"
        local nodepath="$basepath/aliases/led-$1"
 
        [ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
        local nodepath="$basepath/aliases/led-$1"
 
        [ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
index d9758f50f6b9b984142e06685be98db4f787e2a3..6459e30421cc8f6e75d5ca6d658e9f615c8255fa 100644 (file)
@@ -3,7 +3,7 @@
 lantiq_get_dt_led() {
        local label
        local ledpath
 lantiq_get_dt_led() {
        local label
        local ledpath
-       local basepath="/sys/firmware/devicetree/base"
+       local basepath="/proc/device-tree/base"
        local nodepath="$basepath/aliases/led-$1"
 
        [ -f "$nodepath" ] && ledpath=$(cat "$nodepath")
        local nodepath="$basepath/aliases/led-$1"
 
        [ -f "$nodepath" ] && ledpath=$(cat "$nodepath")