From: Michael Tremer Date: Thu, 17 Aug 2017 19:43:13 +0000 (+0000) Subject: device_get_all: Drop function X-Git-Tag: 010~244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91aeb1be572f01c3165504d2010634628242a11c;p=network.git device_get_all: Drop function This is basically device_list which is used everywhere else in the code. Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.device b/src/functions/functions.device index 5ac03c60..a2cfb9f5 100644 --- a/src/functions/functions.device +++ b/src/functions/functions.device @@ -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} diff --git a/src/functions/functions.phy b/src/functions/functions.phy index a0a53ff5..e80b1221 100644 --- a/src/functions/functions.phy +++ b/src/functions/functions.phy @@ -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