return -ENFILE; /* Odd error, that should be noticable */ 
return -ENFILE; /* Odd error, that should be noticeable */ 
static int pwc_isoc_init(struct pwc_device *pdev){	struct usb_device *udev;	struct urb *urb;	int i, j, ret;	struct usb_interface *intf;	struct usb_host_interface *idesc = NULL;	if (pdev == NULL)		return -EFAULT;	if (pdev->iso_init)		return 0;	pdev->vsync = 0;	udev = pdev->udev;	/* Get the current alternate interface, adjust packet size */	if (!udev->actconfig)		return -EFAULT;#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5)	idesc = &udev->actconfig->interface[0]->altsetting[pdev->valternate];#else	intf = usb_ifnum_to_if(udev, 0);	if (intf)		idesc = usb_altnum_to_altsetting(intf, pdev->valternate);#endif			if (!idesc)		return -EFAULT;	/* Search video endpoint */	pdev->vmax_packet_size = -1;	for (i = 0; i < idesc->desc.bNumEndpoints; i++)		if ((idesc->endpoint[i].desc.bEndpointAddress & 0xF) == pdev->vendpoint) {			pdev->vmax_packet_size = le16_to_cpu(idesc->endpoint[i].desc.wMaxPacketSize);			break;		}		if (pdev->vmax_packet_size < 0 || pdev->vmax_packet_size > ISO_MAX_FRAME_SIZE) {		Err("Failed to find packet size for video endpoint in current alternate setting.\n");		return -ENFILE; /* Odd error, that should be noticable */	}	/* Set alternate interface */	ret = 0;	Trace(TRACE_OPEN, "Setting alternate interface %d\n", pdev->valternate);	ret = usb_set_interface(pdev->udev, 0, pdev->valternate);	if (ret < 0)		return ret;	for (i = 0; i < MAX_ISO_BUFS; i++) {		urb = usb_alloc_urb(ISO_FRAMES_PER_DESC, GFP_KERNEL);		if (urb == NULL) {			Err("Failed to allocate urb %d\n", i);			ret = -ENOMEM;			break;		}		pdev->sbuf[i].urb = urb;		Trace(TRACE_MEMORY, "Allocated URB at 0x%p\n", urb);	}	if (ret) {		/* De-allocate in reverse order */		while (i >= 0) {			if (pdev->sbuf[i].urb != NULL)				usb_free_urb(pdev->sbuf[i].urb);			pdev->sbuf[i].urb = NULL;			i--;		}		return ret;	}	/* init URB structure */		for (i = 0; i < MAX_ISO_BUFS; i++) {		urb = pdev->sbuf[i].urb;		urb->interval = 1; // devik		urb->dev = udev;	        urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint);		urb->transfer_flags = URB_ISO_ASAP;	        urb->transfer_buffer = pdev->sbuf[i].data;	        urb->transfer_buffer_length = ISO_BUFFER_SIZE;	        urb->complete = pwc_isoc_handler;	        urb->context = pdev;		urb->start_frame = 0;		urb->number_of_packets = ISO_FRAMES_PER_DESC;		for (j = 0; j < ISO_FRAMES_PER_DESC; j++) {			urb->iso_frame_desc[j].offset = j * ISO_MAX_FRAME_SIZE;			urb->iso_frame_desc[j].length = pdev->vmax_packet_size;		}	}	/* link */	for (i = 0; i < MAX_ISO_BUFS; i++) {		ret = usb_submit_urb(pdev->sbuf[i].urb, GFP_KERNEL);		if (ret)			Err("isoc_init() submit_urb %d failed with error %d\n", i, ret);		else			Trace(TRACE_MEMORY, "URB 0x%p submitted.\n", pdev->sbuf[i].urb);	}	/* All is done... */	pdev->iso_init = 1;	Trace(TRACE_OPEN, "<< pwc_isoc_init()\n");	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/093cf723b2b06d774929ea07982f6a466ff22314/pwc-if.c/clean/drivers/usb/media/pwc/pwc-if.c