[PATCH] bios: hda_audio: skip the test if audio devices don't exist (LP: #1285571)
Colin King
colin.king at canonical.com
Thu Feb 27 09:37:20 UTC 2014
From: Colin Ian King <colin.king at canonical.com>
When running this test on an ARM server that did not have any sound
devices this test just silently did nothing. This small fix makes
the test report that it could not find any audio devices and will
mark the test as skipped.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/bios/hdaaudio/hdaaudio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c
index b30beb4..e4d0b21 100644
--- a/src/bios/hdaaudio/hdaaudio.c
+++ b/src/bios/hdaaudio/hdaaudio.c
@@ -152,8 +152,10 @@ static int hda_audio_test1(fwts_framework *fw)
struct dirent *directory;
bool checked = false;
- if ((dir = opendir("/sys/class/sound/")) == NULL)
- return FWTS_ERROR;
+ if ((dir = opendir("/sys/class/sound")) == NULL) {
+ fwts_skipped(fw, "Cannot find any sound devices in /sys/class/sound.");
+ return FWTS_OK;
+ }
while ((directory = readdir(dir)) != NULL)
if (strncmp(directory->d_name, "hw", 2) == 0) {
--
1.9.0
More information about the fwts-devel
mailing list