ar71xx: refactor 10-ath9k-eeprom
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 19 Dec 2015 11:28:30 +0000 (11:28 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 19 Dec 2015 11:28:30 +0000 (11:28 +0000)
move all library includes and 'firmware already exists'
check to the top of the script.

Signed-off-by: Chris R Blake <chrisrblake93@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47947 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom

index 5398e76..33b1d74 100644 (file)
@@ -1,5 +1,11 @@
 #!/bin/sh
 
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/ar71xx.sh
+. /lib/functions.sh
+. /lib/functions/system.sh
+
 ath9k_eeprom_die() {
        echo "ath9k eeprom: " "$*"
        exit 1
@@ -27,12 +33,6 @@ ath9k_patch_firmware_mac() {
        macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=2 count=6
 }
 
-[ -e /lib/firmware/$FIRMWARE ] && exit 0
-
-. /lib/ar71xx.sh
-. /lib/functions.sh
-. /lib/functions/system.sh
-
 board=$(ar71xx_board_name)
 
 case "$FIRMWARE" in