cobalt: migrate platform to common led helper functions
authorFlorian Fainelli <florian@openwrt.org>
Mon, 18 Feb 2013 10:37:58 +0000 (10:37 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Mon, 18 Feb 2013 10:37:58 +0000 (10:37 +0000)
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 35662

target/linux/cobalt/base-files/etc/diag.sh

index 070c218b3fdc50945b097b26147fbf01254f9277..60849855dc2fcf4f4e7b288403b05e6460220c3d 100644 (file)
@@ -1,20 +1,17 @@
 #!/bin/sh
-# Copyright (C) 2009-2011 OpenWrt.org
+# Copyright (C) 2009-2013 OpenWrt.org
 
-front_led=/sys/class/leds/qube::front
+. /lib/functions/leds.sh
+
+status_led="qube::front"
 
 set_state() {
-        case "$1" in
-                preinit)
-                        [ -d $front_led ] && {
-                                echo none > $front_led/trigger
-                                echo 255 > $front_led/brightness
-                        }
-                ;;
-                done)
-                        [ -d $front_led ] && {
-                               echo 0 > $front_led/brightness
-                        }
-                ;;
-        esac
+       case "$1" in
+       preinit)
+               status_led_on
+               ;;
+       done)
+               status_led_off
+               ;;
+       esac
 }