[LEDE-DEV] [PATCH ver. B] ramips: unify etc/board.d/01_leds configuration

p.wassi at gmx.at p.wassi at gmx.at
Tue Jul 26 22:59:28 PDT 2016


Just to transport the idea what I'm thinking of:
take set_wifi_led as an example. Imagine the function was built like this:

> set_wifi_led() {
> 	case $# in
> 		1|\
> 		2)
> 		        ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
> 			;;
> 		4)
> 		        ucidef_set_led_netdev "${1}" "${2}" "${3}" "${4}"
> 			;;
> 		*)
> 			echo "Something went wrong"
> 			;;
> 	esac
> }

Then we'd have a single function capable of all LED configurations and could
replace the (wild?) mix of different function calls in the 01_leds file.
However, the question that arises for me: why not directly put this
functionality in ucidef_set_led_usbdev ?
No more need to maintain different (local) functions for each platform.

Best regards,
P. Wassi



More information about the Lede-dev mailing list