]> www.infradead.org Git - mtd-utils.git/commitdiff
load_nandsim.sh: remove useless function
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Aug 2012 07:01:18 +0000 (10:01 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Aug 2012 07:03:30 +0000 (10:03 +0300)
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>
load_nandsim.sh

index bda3c790cf526c72ba527e6030c954443158b6ea..18f788e515d2eeb5e13b0124b69692423d6b0efe 100755 (executable)
@@ -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