The test removing can module fail on DRA7 due to can_bcm using it.
This patchs handle this case.
Bug-AGL: SPEC-3064
Change-Id: I272e0ea62786fb43c4ea68601f2fb12864a279b6
Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
if [ ! -e /sys/class/net/can1 ];then
lava-test-case show_can_modules --result skip
if [ ! -e /sys/class/net/can1 ];then
lava-test-case show_can_modules --result skip
+# handle "rmmod: ERROR: Module can is in use by: can_bcm"
+lsmod | grep -q can_bcm
+if [ $? -eq 0 ];then
+ CAN_BCM=1
+ remove_module can_bcm
+fi
+
remove_module can
remove_module c_can_platform
remove_module can
remove_module c_can_platform
modprobe_module rcar_can
fi
modprobe_module rcar_can
fi
+if [ $CAN_BCM -eq 1 ];then
+ modprobe_module can_bcm
+fi
+
#Make sure always that the can interface is down before
#starting the config step.
ip link set can0 down
#Make sure always that the can interface is down before
#starting the config step.
ip link set can0 down