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>
# 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