Commit 53d6437b authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

unbind.sh: fix ioat unbind to work with 'set -e'



Since the grep would fail for most devices and the result wasn't
checked, the script would exit on the first device ID that didn't match.

Also initialize $rootdir so ioat_pci.h can be located.

Change-Id: I6a714772e22692ab002e1971134d2a86edc81d92
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 3c10754a
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

set -e

rootdir=$(readlink -f $(dirname $0))/..

function prep_nvme {
	TMP=`mktemp`
	# Get vendor_id:device_id by nvme's class_id and subcalss_id
@@ -24,8 +26,7 @@ function prep_ioat {

	for device in `cat $TMP`
	do
		result=`lspci -n | grep "$vendor:$device"`
		if [ "$result" ]
		if lspci -n | grep "$vendor:$device"
		then
			echo $vendor $device > /sys/bus/pci/drivers/uio_pci_generic/new_id
		fi