ChangeSet 1.1018.1.3, 2003/04/04 16:13:21-08:00, oliver@neukum.org [PATCH] USB: removing unnecessary calls to usb_set_configuration - remove unnecessary calls to usb_set_configuration drivers/usb/class/usb-midi.c | 31 ------------------------------- 1 files changed, 31 deletions(-) diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c --- a/drivers/usb/class/usb-midi.c Mon Apr 7 15:14:54 2003 +++ b/drivers/usb/class/usb-midi.c Mon Apr 7 15:14:54 2003 @@ -1806,22 +1806,6 @@ printk(KERN_INFO "usb-midi: Found YAMAHA USB-MIDI device on dev %04x:%04x, iface %d\n", d->descriptor.idVendor, d->descriptor.idProduct, ifnum); - for ( i=0 ; i < d->descriptor.bNumConfigurations ; i++ ) { - if ( d->config+i == c ) goto configfound; - } - - printk(KERN_INFO "usb-midi: Config not found.\n"); - - return -EINVAL; - - configfound: - - /* this may not be necessary. */ - if ( usb_set_configuration( d, c->desc.bConfigurationValue ) < 0 ) { - printk(KERN_INFO "usb-midi: Could not set config.\n"); - return -EINVAL; - } - ret = usb_get_descriptor( d, USB_DT_CONFIG, i, buf, USB_DT_CONFIG_SIZE ); if ( ret < 0 ) { printk(KERN_INFO "usb-midi: Could not get config (error=%d).\n", ret); @@ -1916,21 +1900,6 @@ printk(KERN_INFO "usb-midi: Found MIDISTREAMING on dev %04x:%04x, iface %d\n", d->descriptor.idVendor, d->descriptor.idProduct, ifnum); - for ( i=0 ; i < d->descriptor.bNumConfigurations ; i++ ) { - if ( d->config+i == c ) goto configfound; - } - - printk(KERN_INFO "usb-midi: Config not found.\n"); - - return -EINVAL; - - configfound: - - /* this may not be necessary. */ - if ( usb_set_configuration( d, c->desc.bConfigurationValue ) < 0 ) { - printk(KERN_INFO "usb-midi: Could not set config.\n"); - return -EINVAL; - } /* From USB Spec v2.0, Section 9.5. If the class or vendor specific descriptors use the same format