setup.sh: use pci_dev_echo in linux_unbind_driver
This function should be changed as well but was overlooked. Fixing this here. Change-Id: I2f7c8e475d89cfe177441e1843d3713397f6fe7b Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/c/444079 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
d8cf37d015
commit
fdcd8b708a
@ -117,19 +117,17 @@ function linux_bind_driver() {
|
||||
}
|
||||
|
||||
function linux_unbind_driver() {
|
||||
bdf="$1"
|
||||
ven_dev_id=$(lspci -n -s $bdf | cut -d' ' -f3 | sed 's/:/ /')
|
||||
local bdf="$1"
|
||||
local ven_dev_id=$(lspci -n -s $bdf | cut -d' ' -f3 | sed 's/:/ /')
|
||||
local old_driver_name="no driver"
|
||||
|
||||
if ! [ -e "/sys/bus/pci/devices/$bdf/driver" ]; then
|
||||
pci_dev_echo "$bdf" "Can't unbind device as it is not using any driver."
|
||||
return 0
|
||||
if [ -e "/sys/bus/pci/devices/$bdf/driver" ]; then
|
||||
old_driver_name=$(basename $(readlink /sys/bus/pci/devices/$bdf/driver))
|
||||
echo "$ven_dev_id" > "/sys/bus/pci/devices/$bdf/driver/remove_id" 2> /dev/null || true
|
||||
echo "$bdf" > "/sys/bus/pci/devices/$bdf/driver/unbind"
|
||||
fi
|
||||
|
||||
old_driver_name=$(basename $(readlink /sys/bus/pci/devices/$bdf/driver))
|
||||
|
||||
echo "$ven_dev_id" > "/sys/bus/pci/devices/$bdf/driver/remove_id" 2> /dev/null || true
|
||||
echo "$bdf" > "/sys/bus/pci/devices/$bdf/driver/unbind"
|
||||
echo "$bdf ($ven_dev_id): $old_driver_name -> no driver"
|
||||
pci_dev_echo "$bdf" "$old_driver_name -> no driver"
|
||||
}
|
||||
|
||||
function linux_hugetlbfs_mounts() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user