From: Artem Bityutskiy Date: Fri, 3 Aug 2012 07:01:18 +0000 (+0300) Subject: load_nandsim.sh: remove useless function X-Git-Tag: v1.5.1~66 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=98c73936ffe9ad7d308b619f9ec985555493d095;p=mtd-utils.git 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 --- 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