[alsa-devel] [PATCH] ALSA: hda - check proper return value

Wang Xingchao xingchao.wang at intel.com
Thu Jun 7 10:52:07 CEST 2012


snd_hda_param_read() return value -1 means error, others are responses

Signed-off-by: Wang Xingchao <xingchao.wang at intel.com>
---
 sound/pci/hda/hda_proc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 79d0188..99316a7 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -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 pwr = snd_hda_codec_read(codec, nid, 0,
 				     AC_VERB_GET_POWER_STATE, 0);
-	if (sup)
+	if (sup != -1)
 		snd_iprintf(buffer, "  Power states: %s\n",
 			    bits_names(sup, names, ARRAY_SIZE(names)));
 
-- 
1.7.9.5



More information about the Alsa-devel mailing list