From 06ffc1ebddbed88662a47646ff6aa6a2b41f0aec Mon Sep 17 00:00:00 2001 From: Eldad Zack Date: Wed, 3 Apr 2013 23:18:54 +0200 Subject: ALSA: usb-audio: UAC2: do clock validity check earlier Move the check that parse_audio_format_rates_v2() do after receiving the clock source entity ID directly into the find function and add a validation flag to the function. This patch does not introduce any logic flow change. It is provided to allow introducing automatic clock switching easier later. By moving this uac_clock_source_is_valid callsite, 2 additional callsites can be avoided. Signed-off-by: Eldad Zack Signed-off-by: Takashi Iwai --- sound/usb/format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/usb/format.c') diff --git a/sound/usb/format.c b/sound/usb/format.c index a695cafc0599..20c775170959 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -280,7 +280,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, struct usb_device *dev = chip->dev; unsigned char tmp[2], *data; int nr_triplets, data_size, ret = 0; - int clock = snd_usb_clock_find_source(chip, fp->clock); + int clock = snd_usb_clock_find_source(chip, fp->clock, false); if (clock < 0) { snd_printk(KERN_ERR "%s(): unable to find clock source (clock %d)\n", -- cgit v1.2.3