diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-09-16 07:33:21 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-09-16 07:33:21 +0200 |
commit | c91925db4925ba0d145478f02c093369196936e9 (patch) | |
tree | 0e5da4211de3c18b65337c3094ec15994cf2534a /sound/usb/format.c | |
parent | 977ddd6b2e63716cfefe669bbdb30ec0bcea1fe4 (diff) | |
parent | 3894335876a6257ac46e14845bd37ae6fb0f7c87 (diff) | |
download | op-kernel-dev-c91925db4925ba0d145478f02c093369196936e9.zip op-kernel-dev-c91925db4925ba0d145478f02c093369196936e9.tar.gz |
Merge branch 'fix/hda' into topic/hda
Diffstat (limited to 'sound/usb/format.c')
-rw-r--r-- | sound/usb/format.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c index 3a13754..6914821 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c @@ -49,7 +49,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, u64 pcm_formats; switch (protocol) { - case UAC_VERSION_1: { + case UAC_VERSION_1: + default: { struct uac_format_type_i_discrete_descriptor *fmt = _fmt; sample_width = fmt->bBitResolution; sample_bytes = fmt->bSubframeSize; @@ -64,9 +65,6 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, format <<= 1; break; } - - default: - return -EINVAL; } pcm_formats = 0; @@ -384,6 +382,10 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, * audio class v2 uses class specific EP0 range requests for that. */ switch (protocol) { + default: + snd_printdd(KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n", + chip->dev->devnum, fp->iface, fp->altsetting, protocol); + /* fall through */ case UAC_VERSION_1: fp->channels = fmt->bNrChannels; ret = parse_audio_format_rates_v1(chip, fp, (unsigned char *) fmt, 7); @@ -392,10 +394,6 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, /* fp->channels is already set in this case */ ret = parse_audio_format_rates_v2(chip, fp); break; - default: - snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", - chip->dev->devnum, fp->iface, fp->altsetting, protocol); - return -EINVAL; } if (fp->channels < 1) { @@ -438,6 +436,10 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, fp->channels = 1; switch (protocol) { + default: + snd_printdd(KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n", + chip->dev->devnum, fp->iface, fp->altsetting, protocol); + /* fall through */ case UAC_VERSION_1: { struct uac_format_type_ii_discrete_descriptor *fmt = _fmt; brate = le16_to_cpu(fmt->wMaxBitRate); @@ -456,10 +458,6 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, ret = parse_audio_format_rates_v2(chip, fp); break; } - default: - snd_printk(KERN_ERR "%d:%u:%d : invalid protocol version %d\n", - chip->dev->devnum, fp->iface, fp->altsetting, protocol); - return -EINVAL; } return ret; |