mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-12 16:36:48 +07:00
ALSA: hda - check proper return value
snd_hda_param_read() return value -1 means error, others are responses Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
0f4ccbb025
commit
e076eb5c95
@ -451,7 +451,7 @@ static void print_power_state(struct snd_info_buffer *buffer,
|
|||||||
int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE);
|
int sup = snd_hda_param_read(codec, nid, AC_PAR_POWER_STATE);
|
||||||
int pwr = snd_hda_codec_read(codec, nid, 0,
|
int pwr = snd_hda_codec_read(codec, nid, 0,
|
||||||
AC_VERB_GET_POWER_STATE, 0);
|
AC_VERB_GET_POWER_STATE, 0);
|
||||||
if (sup)
|
if (sup != -1)
|
||||||
snd_iprintf(buffer, " Power states: %s\n",
|
snd_iprintf(buffer, " Power states: %s\n",
|
||||||
bits_names(sup, names, ARRAY_SIZE(names)));
|
bits_names(sup, names, ARRAY_SIZE(names)));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user