X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fdevice.sh;h=8eb0702bbd1d28a1320bde452fedb11f8b5bae9d;hb=7ee96d31b8f023c85c75c4ab4fd9b82457353ed8;hp=a94244e52c9746d9baf24d78278f9b0b6c1ba509;hpb=402a7e1bcdf4724b23b02070edb1140008b2a489;p=csit.git diff --git a/resources/libraries/bash/function/device.sh b/resources/libraries/bash/function/device.sh index a94244e52c..8eb0702bbd 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}!" }