From patchwork Tue Jul 16 17:39:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 259477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 289192C00BF for ; Wed, 17 Jul 2013 03:39:30 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Uz9Dk-0002qb-Uc; Tue, 16 Jul 2013 17:39:28 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Uz9DN-0002pH-6L for fwts-devel@lists.ubuntu.com; Tue, 16 Jul 2013 17:39:05 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Uz9DN-0001j2-3A for fwts-devel@lists.ubuntu.com; Tue, 16 Jul 2013 17:39:05 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] bios: hdaaudio: skip the test if no BIOS pin config found (LP: #1201903) Date: Tue, 16 Jul 2013 18:39:04 +0100 Message-Id: <1373996344-13984-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King We should print out a message and skip the test rather than silently do nothing if no BIOS audio pin configs are found. Signed-off-by: Colin Ian King Acked-by: Ivan Hu Acked-by: Keng-Yu Lin --- src/bios/hdaaudio/hdaaudio.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c index ad482b6..6d47228 100644 --- a/src/bios/hdaaudio/hdaaudio.c +++ b/src/bios/hdaaudio/hdaaudio.c @@ -150,6 +150,7 @@ static int hda_audio_test1(fwts_framework *fw) { DIR *dir; struct dirent *directory; + bool checked = false; if ((dir = opendir("/sys/class/sound/")) == NULL) return FWTS_ERROR; @@ -157,6 +158,8 @@ static int hda_audio_test1(fwts_framework *fw) while ((directory = readdir(dir)) != NULL) if (strncmp(directory->d_name, "hw", 2) == 0) { char path[PATH_MAX]; + + checked = true; snprintf(path, sizeof(path), "/sys/class/sound/%s", directory->d_name); fwts_log_info(fw, "Checking '%s':", directory->d_name); @@ -166,6 +169,9 @@ static int hda_audio_test1(fwts_framework *fw) closedir(dir); + if (!checked) + fwts_skipped(fw, "Cannot find any BIOS set audio pin configurations."); + return FWTS_OK; }