Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248188
b: refs/heads/master
c: 3bc6fbc
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed May 18, 2011
1 parent 23e05c0 commit a103c71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ef283247a0cf0fd2e8370ee467030292eb3129e
refs/heads/master: 3bc6fbc7439a88969de97d979795ce7847950668
11 changes: 10 additions & 1 deletion trunk/sound/usb/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)
int err;
unsigned char data;
struct usb_device *dev = chip->dev;
struct uac_clock_source_descriptor *cs_desc =
snd_usb_find_clock_source(chip->ctrl_intf, source_id);

if (!cs_desc)
return 0;

/* If a clock source can't tell us whether it's valid, we assume it is */
if (!uac2_control_is_readable(cs_desc->bmControls, UAC2_CS_CONTROL_CLOCK_VALID))
return 1;

err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR,
USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
Expand All @@ -114,7 +123,7 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)
if (err < 0) {
snd_printk(KERN_WARNING "%s(): cannot get clock validity for id %d\n",
__func__, source_id);
return err;
return 0;
}

return !!data;
Expand Down

0 comments on commit a103c71

Please sign in to comment.