4343 */
4444static u64 parse_audio_format_i_type (struct snd_usb_audio * chip ,
4545 struct audioformat * fp ,
46- unsigned int format , void * _fmt ,
47- int protocol )
46+ unsigned int format , void * _fmt )
4847{
4948 int sample_width , sample_bytes ;
5049 u64 pcm_formats = 0 ;
5150
52- switch (protocol ) {
51+ switch (fp -> protocol ) {
5352 case UAC_VERSION_1 :
5453 default : {
5554 struct uac_format_type_i_discrete_descriptor * fmt = _fmt ;
@@ -360,11 +359,8 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip,
360359 */
361360static int parse_audio_format_i (struct snd_usb_audio * chip ,
362361 struct audioformat * fp , unsigned int format ,
363- struct uac_format_type_i_continuous_descriptor * fmt ,
364- struct usb_host_interface * iface )
362+ struct uac_format_type_i_continuous_descriptor * fmt )
365363{
366- struct usb_interface_descriptor * altsd = get_iface_desc (iface );
367- int protocol = altsd -> bInterfaceProtocol ;
368364 snd_pcm_format_t pcm_format ;
369365 int ret ;
370366
@@ -387,8 +383,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
387383 }
388384 fp -> formats = pcm_format_to_bits (pcm_format );
389385 } else {
390- fp -> formats = parse_audio_format_i_type (chip , fp , format ,
391- fmt , protocol );
386+ fp -> formats = parse_audio_format_i_type (chip , fp , format , fmt );
392387 if (!fp -> formats )
393388 return - EINVAL ;
394389 }
@@ -398,11 +393,8 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
398393 * proprietary class specific descriptor.
399394 * audio class v2 uses class specific EP0 range requests for that.
400395 */
401- switch (protocol ) {
396+ switch (fp -> protocol ) {
402397 default :
403- snd_printdd (KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n" ,
404- chip -> dev -> devnum , fp -> iface , fp -> altsetting , protocol );
405- /* fall through */
406398 case UAC_VERSION_1 :
407399 fp -> channels = fmt -> bNrChannels ;
408400 ret = parse_audio_format_rates_v1 (chip , fp , (unsigned char * ) fmt , 7 );
@@ -427,12 +419,9 @@ static int parse_audio_format_i(struct snd_usb_audio *chip,
427419 */
428420static int parse_audio_format_ii (struct snd_usb_audio * chip ,
429421 struct audioformat * fp ,
430- int format , void * _fmt ,
431- struct usb_host_interface * iface )
422+ int format , void * _fmt )
432423{
433424 int brate , framesize , ret ;
434- struct usb_interface_descriptor * altsd = get_iface_desc (iface );
435- int protocol = altsd -> bInterfaceProtocol ;
436425
437426 switch (format ) {
438427 case UAC_FORMAT_TYPE_II_AC3 :
@@ -452,11 +441,8 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
452441
453442 fp -> channels = 1 ;
454443
455- switch (protocol ) {
444+ switch (fp -> protocol ) {
456445 default :
457- snd_printdd (KERN_WARNING "%d:%u:%d : invalid protocol version %d, assuming v1\n" ,
458- chip -> dev -> devnum , fp -> iface , fp -> altsetting , protocol );
459- /* fall through */
460446 case UAC_VERSION_1 : {
461447 struct uac_format_type_ii_discrete_descriptor * fmt = _fmt ;
462448 brate = le16_to_cpu (fmt -> wMaxBitRate );
@@ -483,17 +469,17 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip,
483469int snd_usb_parse_audio_format (struct snd_usb_audio * chip ,
484470 struct audioformat * fp , unsigned int format ,
485471 struct uac_format_type_i_continuous_descriptor * fmt ,
486- int stream , struct usb_host_interface * iface )
472+ int stream )
487473{
488474 int err ;
489475
490476 switch (fmt -> bFormatType ) {
491477 case UAC_FORMAT_TYPE_I :
492478 case UAC_FORMAT_TYPE_III :
493- err = parse_audio_format_i (chip , fp , format , fmt , iface );
479+ err = parse_audio_format_i (chip , fp , format , fmt );
494480 break ;
495481 case UAC_FORMAT_TYPE_II :
496- err = parse_audio_format_ii (chip , fp , format , fmt , iface );
482+ err = parse_audio_format_ii (chip , fp , format , fmt );
497483 break ;
498484 default :
499485 snd_printd (KERN_INFO "%d:%u:%d : format type %d is not supported yet\n" ,
0 commit comments