From 98c73936ffe9ad7d308b619f9ec985555493d095 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 3 Aug 2012 10:01:18 +0300 Subject: 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 --- load_nandsim.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'load_nandsim.sh') 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 -- cgit v1.2.3