X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fdevice.sh;h=729a837b33d1cbd495614fc5aeac0d70cb0ff692;hp=d9af5fff1aed708d4458dccbba3e4ee2e6d5a27d;hb=71d7150a65a7c006bf46b2c1001dbaa00b5681fb;hpb=938d89a6d00a6bd4e2dd9ca870d0f1e62f144f93 diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh index d9af5fff1a..729a837b33 100644 --- a/resources/libraries/bash/function/device.sh +++ b/resources/libraries/bash/function/device.sh @@ -98,15 +98,11 @@ function bind_interfaces_to_driver () { pci_path="/sys/bus/pci/devices/${ADDR}" drv_path="/sys/bus/pci/drivers/${DRIVER}" - vd=$(cat ${pci_path}/vendor ${pci_path}/device) || { - die "Failed to retrieve interface details!" - } - set +e - echo ${vd} | sudo tee ${drv_path}/new_id - set -e - echo ${ADDR} | sudo tee ${pci_path}/driver/unbind || { - die "Failed to unbind interface ${ADDR}!" - } + if [ -d "${pci_path}/driver" ]; then + echo ${ADDR} | sudo tee ${pci_path}/driver/unbind || { + die "Failed to unbind interface ${ADDR}!" + } + fi echo ${ADDR} | sudo tee ${drv_path}/bind || { die "Failed to bind interface ${ADDR}!" }