]> git.ipfire.org Git - people/stevee/network.git/commitdiff
device_get_all: Drop function
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 19:43:13 +0000 (19:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 20:06:44 +0000 (20:06 +0000)
This is basically device_list which is used everywhere else
in the code.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.device
src/functions/functions.phy

index 5ac03c60dda6ce1f7020eaa05dd95566fa8da5e0..a2cfb9f5ce5e9ad76359c23b1024dd043cb6f9b4 100644 (file)
@@ -23,7 +23,10 @@ device_list() {
        local devices
 
        # Add all interfaces
-       list_append devices $(devices_get_all)
+       local device
+       for device in $(list_directory ${SYS_CLASS_NET}); do
+               list_append_one devices "${device}"
+       done
 
        # Add all PHYs
        list_append devices $(phy_list)
@@ -500,10 +503,6 @@ device_get() {
        return ${EXIT_OK}
 }
 
-devices_get_all() {
-       device_get
-}
-
 # Check if a device has a cable plugged in
 device_has_carrier() {
        local device=${1}
index a0a53ff531e6c1b6500317bb825bbc6d326d9aae..e80b1221528123fc84987e04537ce3f773435661 100644 (file)
@@ -90,7 +90,7 @@ phy_get_devices() {
        assert isset phy
 
        local device
-       for device in $(devices_get_all); do
+       for device in $(device_list); do
                local p="$(device_get_phy "${device}")"
 
                if [ "${phy}" = "${p}" ]; then