From patchwork Thu Sep 4 12:21:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 4845651 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A1B19F2EC for ; Thu, 4 Sep 2014 13:27:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04FB820270 for ; Thu, 4 Sep 2014 13:27:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 972BF20260 for ; Thu, 4 Sep 2014 13:27:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 341132656FF; Thu, 4 Sep 2014 15:27:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 14333265811; Thu, 4 Sep 2014 15:07:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D3BB2265810; Thu, 4 Sep 2014 15:07:37 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 1CED926589F for ; Thu, 4 Sep 2014 14:21:07 +0200 (CEST) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XPW2E-0001P1-6S; Thu, 04 Sep 2014 12:21:06 +0000 From: David Henningsson To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Thu, 4 Sep 2014 14:21:05 +0200 Message-Id: <1409833267-9778-4-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409833267-9778-1-git-send-email-david.henningsson@canonical.com> References: <1409833267-9778-1-git-send-email-david.henningsson@canonical.com> Cc: David Henningsson Subject: [alsa-devel] [PATCH 3/5] hda-emu: Improve error message for modem codecs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In some cases (when codec index parameter was specified), selecting a modem codec resulted in "ERROR -77", which was confusing. Signed-off-by: David Henningsson --- hda-parse.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hda-parse.c b/hda-parse.c index 57e9ee3..b5abd5e 100644 --- a/hda-parse.c +++ b/hda-parse.c @@ -675,13 +675,17 @@ int parse_codec_proc(FILE *fp, struct xhda_codec *codecp, int codec_index) parse_mode = PARSE_ROOT; } err = parse_codec_recursive(buffer); - if (err < 0) { - if (err == -EBADFD && codec_index < 0) { + if (err == -EBADFD) { + if (codec_index < 0) { hda_log(HDA_LOG_INFO, "Codec %d is a modem codec, skipping\n", curidx); parse_mode = PARSE_START; clear_codec(codec); continue; } + hda_log(HDA_LOG_ERR, "Codec %d is a modem codec, aborting\n", curidx); + return err; + } + else if (err < 0) { hda_log(HDA_LOG_ERR, "ERROR %d\n", err); return err; }