Skip to content

Commit

Permalink
tools: tests: remove dependency on grep
Browse files Browse the repository at this point in the history
We only use grep in one place where we don't really need it as we can use
find directly.

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Suggested-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240528-fix-bash-tests-v3-4-e9b5be2ba8bf@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
  • Loading branch information
Bartosz Golaszewski committed May 29, 2024
1 parent d75d591 commit b569b91
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions tools/gpio-tools-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,10 @@ gpiosim_cleanup() {
local BANKPATH=$DEVPATH/bank0

echo 0 > $DEVPATH/live

ls $BANKPATH/line* > /dev/null 2>&1
if [ "$?" = "0" ]
then
for LINE in $(find $BANKPATH/ | grep -E "line[0-9]+$")
do
test -e $LINE/hog && rmdir $LINE/hog
rmdir $LINE
done
fi

rmdir $BANKPATH
rmdir $DEVPATH
find "$DEVPATH" -type d -name hog -exec rmdir '{}' '+'
find "$DEVPATH" -type d -name "line*" -exec rmdir '{}' '+'
find "$DEVPATH" -type d -name "bank*" -exec rmdir '{}' '+'
rmdir "$DEVPATH"
done

gpiosim_chip_symlink_cleanup
Expand Down Expand Up @@ -3078,7 +3069,6 @@ check_prog() {
check_prog shunit2
check_prog modprobe
check_prog timeout
check_prog grep

# Check if we're running a kernel at the required version or later
check_kernel $MIN_KERNEL_VERSION
Expand Down

0 comments on commit b569b91

Please sign in to comment.