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

IvanHu ivan.hu at canonical.com
Tue Mar 4 08:33:14 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: Ivan Hu <ivan.hu at canonical.com>




More information about the fwts-devel mailing list