memset(new_desc, 0, sizeof(*new_desc)); 
static int mts_usb_probe(struct usb_interface *intf,			 const struct usb_device_id *id){	int i;	int ep_out = -1;	int ep_in_set[3]; /* this will break if we have more than three endpoints			   which is why we check */	int *ep_in_current = ep_in_set;	int err_retval = -ENOMEM;	struct mts_desc * new_desc;	struct vendor_product const* p;	struct usb_device *dev = interface_to_usbdev (intf);	/* the current altsetting on the interface we're probing */	struct usb_host_interface *altsetting;	MTS_DEBUG_GOT_HERE();	MTS_DEBUG( "usb-device descriptor at %x\n", (int)dev );	MTS_DEBUG( "product id = 0x%x, vendor id = 0x%x\n",		   le16_to_cpu(dev->descriptor.idProduct),		   le16_to_cpu(dev->descriptor.idVendor) );	MTS_DEBUG_GOT_HERE();	p = &mts_supported_products[id - mts_usb_ids];	MTS_DEBUG_GOT_HERE();	MTS_DEBUG( "found model %s\n", p->name );	if ( p->support_status != mts_sup_full )		MTS_MESSAGE( "model %s is not known to be fully supported, reports welcome!\n",			     p->name );	/* the current altsetting on the interface we're probing */	altsetting = intf->cur_altsetting;	/* Check if the config is sane */	if ( altsetting->desc.bNumEndpoints != MTS_EP_TOTAL ) {		MTS_WARNING( "expecting %d got %d endpoints! Bailing out.\n",			     (int)MTS_EP_TOTAL, (int)altsetting->desc.bNumEndpoints );		return -ENODEV;	}	for( i = 0; i < altsetting->desc.bNumEndpoints; i++ ) {		if ((altsetting->endpoint[i].desc.bmAttributes &		     USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_BULK) {			MTS_WARNING( "can only deal with bulk endpoints; endpoint %d is not bulk.\n",			     (int)altsetting->endpoint[i].desc.bEndpointAddress );		} else {			if (altsetting->endpoint[i].desc.bEndpointAddress &			    USB_DIR_IN)				*ep_in_current++					= altsetting->endpoint[i].desc.bEndpointAddress &					USB_ENDPOINT_NUMBER_MASK;			else {				if ( ep_out != -1 ) {					MTS_WARNING( "can only deal with one output endpoints. Bailing out." );					return -ENODEV;				}				ep_out = altsetting->endpoint[i].desc.bEndpointAddress &					USB_ENDPOINT_NUMBER_MASK;			}		}	}	if ( ep_out == -1 ) {		MTS_WARNING( "couldn't find an output bulk endpoint. Bailing out.\n" );		return -ENODEV;	}			new_desc = kmalloc(sizeof(struct mts_desc), GFP_KERNEL);	if (!new_desc)		goto out;	memset(new_desc, 0, sizeof(*new_desc));	new_desc->urb = usb_alloc_urb(0, GFP_KERNEL);	if (!new_desc->urb)		goto out_kfree;	new_desc->usb_dev = dev;	new_desc->usb_intf = intf;	init_MUTEX(&new_desc->lock);	/* endpoints */	new_desc->ep_out = ep_out;	new_desc->ep_response = ep_in_set[0];	new_desc->ep_image = ep_in_set[1];	if ( new_desc->ep_out != MTS_EP_OUT )		MTS_WARNING( "will this work? Command EP is not usually %d\n",			     (int)new_desc->ep_out );	if ( new_desc->ep_response != MTS_EP_RESPONSE )		MTS_WARNING( "will this work? Response EP is not usually %d\n",			     (int)new_desc->ep_response );	if ( new_desc->ep_image != MTS_EP_IMAGE )		MTS_WARNING( "will this work? Image data EP is not usually %d\n",			     (int)new_desc->ep_image );	new_desc->host = scsi_host_alloc(&mts_scsi_host_template,			sizeof(new_desc));	if (!new_desc->host)		goto out_free_urb;	new_desc->host->hostdata[0] = (unsigned long)new_desc;	if (scsi_add_host(new_desc->host, NULL)) {		err_retval = -EIO;		goto out_free_urb;	}	scsi_scan_host(new_desc->host);	usb_set_intfdata(intf, new_desc);	return 0; out_free_urb:	usb_free_urb(new_desc->urb); out_kfree:	kfree(new_desc); out:	return err_retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/61eded6e06a1f4bdbf707b69da904ba9f3eb2f0a/microtek.c/clean/drivers/usb/image/microtek.c