static int findintfep ( struct usb_device * dev , unsigned int ep ) {
 unsigned int i , j , e ;
 struct usb_interface * intf ;
 struct usb_host_interface * alts ;
 struct usb_endpoint_descriptor * endpt ;
 if ( ep & ~ ( USB_DIR_IN | 0xf ) ) return - EINVAL ;
 if ( ! dev -> actconfig ) return - ESRCH ;
 for ( i = 0 ;
 i < dev -> actconfig -> desc . bNumInterfaces ;
 i ++ ) {
 intf = dev -> actconfig -> interface [ i ] ;
 for ( j = 0 ;
 j < intf -> num_altsetting ;
 j ++ ) {
 alts = & intf -> altsetting [ j ] ;
 for ( e = 0 ;
 e < alts -> desc . bNumEndpoints ;
 e ++ ) {
 endpt = & alts -> endpoint [ e ] . desc ;
 if ( endpt -> bEndpointAddress == ep ) return alts -> desc . bInterfaceNumber ;
 }
 }
 }
 return - ENOENT ;
 }
static int findintfep ( struct usb_device * dev , unsigned int ep ) {
 unsigned int i , j , e ;
 struct usb_interface * intf ;
 struct usb_host_interface * alts ;
 struct usb_endpoint_descriptor * endpt ;
 if ( ep & ~ ( USB_DIR_IN | 0xf ) ) return - EINVAL ;
 if ( ! dev -> actconfig ) return - ESRCH ;
 for ( i = 0 ;
 i < dev -> actconfig -> desc . bNumInterfaces ;
 i ++ ) {
 intf = dev -> actconfig -> interface [ i ] ;
 for ( j = 0 ;
 j < intf -> num_altsetting ;
 j ++ ) {
 alts = & intf -> altsetting [ j ] ;
 for ( e = 0 ;
 e < alts -> desc . bNumEndpoints ;
 e ++ ) {
 endpt = & alts -> endpoint [ e ] . desc ;
 if ( endpt -> bEndpointAddress == ep ) return alts -> desc . bInterfaceNumber ;
 }
 }
 }
 return - ENOENT ;
 }