18c2ecf20Sopenharmony_ci#!/bin/sh 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciSRC_TREE=../../../../ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_citest_run() 78c2ecf20Sopenharmony_ci{ 88c2ecf20Sopenharmony_ci if [ -f ${SRC_TREE}/drivers/char/adi.ko ]; then 98c2ecf20Sopenharmony_ci insmod ${SRC_TREE}/drivers/char/adi.ko 2> /dev/null 108c2ecf20Sopenharmony_ci if [ $? -ne 0 ]; then 118c2ecf20Sopenharmony_ci rc=1 128c2ecf20Sopenharmony_ci fi 138c2ecf20Sopenharmony_ci else 148c2ecf20Sopenharmony_ci # Use modprobe dry run to check for missing adi module 158c2ecf20Sopenharmony_ci if ! /sbin/modprobe -q -n adi; then 168c2ecf20Sopenharmony_ci echo "adi: [SKIP]" 178c2ecf20Sopenharmony_ci elif /sbin/modprobe -q adi; then 188c2ecf20Sopenharmony_ci echo "adi: ok" 198c2ecf20Sopenharmony_ci else 208c2ecf20Sopenharmony_ci echo "adi: [FAIL]" 218c2ecf20Sopenharmony_ci rc=1 228c2ecf20Sopenharmony_ci fi 238c2ecf20Sopenharmony_ci fi 248c2ecf20Sopenharmony_ci ./adi-test 258c2ecf20Sopenharmony_ci rmmod adi 2> /dev/null 268c2ecf20Sopenharmony_ci} 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_circ=0 298c2ecf20Sopenharmony_citest_run 308c2ecf20Sopenharmony_ciexit $rc 31