ACK: [PATCH] bios: hda_audio: skip the test if audio devices don't exist (LP: #1285571)

Alex Hung alex.hung at canonical.com
Wed Mar 5 03:44:11 UTC 2014


On 02/27/2014 05:37 PM, Colin King wrote:
> 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) {
> 

Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list