#!/bin/bash
# this script will install module and present it to system ( /dev/... )
# because my driver only supports one physical device and four logic partition,
# our name-rule is /dev/sdmmca, /dev/sdmmca1~4.
# where 'a' in the string,sdmmca, means first physical device
# if your driver support two, add 'b' in the same step if you want
#
# the input argu is your module name
# example1 : sh unload sdmmc
# example2 : sd unload msmspro
#
# cheng tsair-jinn <jinncheng@skymedo.com.tw>
#############################################################################
module=$1
dev_name=$1
dev_extend=a
module_file=$1
#############################################################################
# remove installed module 
#
result=`/sbin/rmmod $module`
if $result
then
	echo "rmmod "${module}" ok"
else
	echo "rmmod "${module}" fail"
	exit 0
fi
#############################################################################
# remove old device name
#
rm -f /dev/${dev_name}${dev_extend}[0-4] /dev/${dev_name}${dev_extend}
exit 1
