Skip to content

Commit

Permalink
sof-dump-status.py: make -s, -i and -l fail on wrong card numbers
Browse files Browse the repository at this point in the history
Yet another green failure. Passing a wrong card number now fails as
expected:

./tools/sof-dump-status.py  -i 42 >/dev/null

Traceback (most recent call last):
  File "./tools/sof-dump-status.py", line 487, in <module>
    card_info = sysinfo.proc_card[str(ret_args['id'])]
KeyError: '42'

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Sep 9, 2021
1 parent 5bb6679 commit 0bb4b66
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tools/sof-dump-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,25 +484,19 @@ def dump_dapm(dapm, filter = "all"):

if ret_args.get('id') is not None:
sysinfo.loadProcSound()
card_info = sysinfo.proc_card.get(str(ret_args['id']))
if card_info is None:
exit(0)
card_info = sysinfo.proc_card[str(ret_args['id'])]
dump_cardinfo_pcm(card_info)
exit(0)

if ret_args.get('short') is not None:
sysinfo.loadProcSound()
card_info = sysinfo.proc_card.get(str(ret_args['short']))
if card_info is None:
exit(0)
card_info = sysinfo.proc_card[str(ret_args['short'])]
print(card_info['short'])
exit(0)

if ret_args.get('longname') is not None:
sysinfo.loadProcSound()
card_info = sysinfo.proc_card.get(str(ret_args['longname']))
if card_info is None:
exit(0)
card_info = sysinfo.proc_card[str(ret_args['longname'])]
print(card_info['longname'])
exit(0)

Expand Down

0 comments on commit 0bb4b66

Please sign in to comment.