summaryrefslogtreecommitdiff
path: root/utils/ipu3/ipu3-process.sh
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-12-11 00:31:24 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-12-11 00:31:24 +0200
commit0d96f3e2322c5eecdd99bf134a2d80429836b778 (patch)
tree64853b8b3848a92f0f4142e9b9754b991074cbf1 /utils/ipu3/ipu3-process.sh
parentad8934db5b29810003a9a66b9c3a49f559ebff15 (diff)
utils: ipu3: Abort when sensor or media device isn't found
Calling exit from a function only exits from the function, it doesn't abort the whole script. Propagate the errors to stop operation when the sensor or media device can't be found. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/ipu3/ipu3-process.sh')
-rwxr-xr-xutils/ipu3/ipu3-process.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/ipu3/ipu3-process.sh b/utils/ipu3/ipu3-process.sh
index 6412aea4..78a7937f 100755
--- a/utils/ipu3/ipu3-process.sh
+++ b/utils/ipu3/ipu3-process.sh
@@ -23,8 +23,8 @@ find_media_device() {
done
if [[ -z $mdev ]] ; then
- echo "IPU3 media device not found." >&2
- exit 1
+ echo "IPU3 media device not found." >&2
+ exit 1
fi
echo $mdev
@@ -173,7 +173,7 @@ fi
out_size=${out_size:-$in_size}
vf_size=${vf_size:-$in_size}
-mdev=$(find_media_device)
+mdev=$(find_media_device) || exit
mediactl="media-ctl -d $mdev"
echo "Using device $mdev"