aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-03 10:19:07 +0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-03 10:19:07 +0300
commit6837ec6fe9b9d915c7bc6605e2ae252ffc1a3316 (patch)
treeab04db392df8a9b1509f71803ac71efe22bfe112
parent37d14ad9bd706a035c6ce3050bfede6c9ac6f12a (diff)
load_nandsim.sh: introduce a separate usage function
Just because this is more readable. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rwxr-xr-xload_nandsim.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/load_nandsim.sh b/load_nandsim.sh
index 87d4f60..1df3813 100755
--- a/load_nandsim.sh
+++ b/load_nandsim.sh
@@ -13,11 +13,8 @@ fatal()
exit 1
}
-if grep -q "NAND simulator" /proc/mtd; then
- fatal "nandsim is already loaded"
-fi
-
-if [ "$#" -lt "1" ]; then
+usage()
+{
cat 1>&2 <<EOF
Load NAND simulator to simulate flash of a specified size.
@@ -58,6 +55,14 @@ Only the following combinations are supported:
| 1024 | 512 | 2048 |
--------------------------------------------------
EOF
+}
+
+if grep -q "NAND simulator" /proc/mtd; then
+ fatal "nandsim is already loaded"
+fi
+
+if [ "$#" -lt "1" ]; then
+ usage
exit 1
fi