Skip to content

Commit

Permalink
case-lib: lib.sh: use debugfs for fw_path when available
Browse files Browse the repository at this point in the history
prefer the use of the debugfs information to the kernel parameter.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart committed Apr 4, 2024
1 parent 7423c19 commit 08f3c34
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,15 @@ fake_kern_error()
get_ldc_subdir()
{
local subdir='intel/sof' # default
if test -e /sys/module/snd_sof_pci/parameters/fw_path; then
local fw_path
fw_path=$(cat /sys/module/snd_sof_pci/parameters/fw_path)
local fw_path
local fw_path_info='/sys/kernel/debug/sof/fw_path'

if test ! -e $fw_path_info; then
fw_path_info='/sys/module/snd_sof_pci/parameters/fw_path'
fi

if fw_path=$(cat $fw_path_info); then
# "cat" was succesful
if [ "$fw_path" != '(null)' ]; then
subdir=${fw_path%/} # strip any trailing slash
subdir=${subdir%/community}
Expand Down

0 comments on commit 08f3c34

Please sign in to comment.