summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-03 10:01:18 +0300
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-03 10:03:30 +0300
commit98c73936ffe9ad7d308b619f9ec985555493d095 (patch)
tree488318cec3ba401354718c50098a53dc7fed7ee0
parent6dcb01b532cc16d07d2698effeda809a57b2e249 (diff)
load_nandsim.sh: remove useless function
We do not really need a separate complex function to check if nandsim is already loaded or not. Besides, it is safer to check /proc/mtd in case nandsim is compiled-in. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rwxr-xr-xload_nandsim.sh13
1 files changed, 1 insertions, 12 deletions
diff --git a/load_nandsim.sh b/load_nandsim.sh
index bda3c79..18f788e 100755
--- a/load_nandsim.sh
+++ b/load_nandsim.sh
@@ -7,18 +7,7 @@
# Author: Artem Bityutskiy
#
-# Check if nandsim module is loaded
-function nandsim_loaded()
-{
- local NANDSIM=`lsmod | grep nandsim`
- if [ -n "$NANDSIM" ]; then
- return 1
- fi
- return 0
-}
-
-nandsim_loaded
-if (( $? != 0 )); then
+if grep -q "NAND simulator" /proc/mtd; then
echo "Error: nandsim is already loaded"
exit 1
fi