soc/intel_adsp: cavstool: don't unload driver when --log-only

Audio users want logging too. This restores feature parity since the
older scripts were removed in commit
cd5302fa00 ("boards/intel_adsp_cavs15: Remove ancient tooling")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit is contained in:
Marc Herbert 2022-01-25 23:07:31 -08:00 committed by Anas Nashif
commit 98f66d7564

View file

@ -37,8 +37,12 @@ def map_regs():
# Check sysfs for a loaded driver and remove it
if os.path.exists(f"{pcidir}/driver"):
mod = os.path.basename(os.readlink(f"{pcidir}/driver/module"))
log.warning(f"Existing driver found! Unloading \"{mod}\" module")
runx(f"rmmod -f {mod}")
found_msg = f"Existing driver \"{mod}\" found"
if args.log_only:
log.info(found_msg)
else:
log.warning(found_msg + ", unloading module")
runx(f"rmmod -f {mod}")
# Disengage runtime power management so the kernel doesn't put it to sleep
with open(f"{pcidir}/power/control", "w") as ctrl: