From: Takashi Iwai Subject: Re: [PATCH] ALSA: hda - check proper return value Date: Thu, 07 Jun 2012 11:42:33 +0200 Message-ID: References: <1339059127-4133-1-git-send-email-xingchao.wang@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id AF0BD10B921 for ; Thu, 7 Jun 2012 11:42:33 +0200 (CEST) In-Reply-To: <1339059127-4133-1-git-send-email-xingchao.wang@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Wang Xingchao Cc: alsa-devel@alsa-project.org, fengguang.wu@intel.com, wangxingchao2011@gmail.com List-Id: alsa-devel@alsa-project.org At Thu, 7 Jun 2012 16:52:07 +0800, Wang Xingchao wrote: > > snd_hda_param_read() return value -1 means error, others are responses > > Signed-off-by: Wang Xingchao Applied now. Thanks. Takashi > --- > 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 >