Re: strange problem with "usb_submit_urb"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 7 Oct 2009, aditya uttam wrote:

> Dear all,
> 
> I am writing driver for my custom usb device.
> In my code the function usb_submit_urb() was returning with error
> number -22 (-EINVAL).
> when I looked into the usb_submit_urb() function I found the statement,
> if (!urb || urb->hcpriv || !urb->complete)
> 		return -EINVAL;
> 
> I verified all the above parameters are fine before calling usb_submit_urb().
> Please find the code snippet I am using.
> 
>       if (!current_urb || current_urb->hcpriv || !current_urb->complete)
> 	printk(" *****************  URB condition Failed **************\n");
>        else
> 	printk("*****************  URB condition Success**************\n");
> 		
> 		
>        /* submit the URB */
>        spin_lock_irqsave(&current_urb_context->us->pusb_dev_spin_lock, flags);
>        status = usb_submit_urb(current_urb, GFP_ATOMIC);
>        spin_unlock_irqrestore(&current_urb_context->us->pusb_dev_spin_lock,
> flags);
> 
> in this code usb_submit_urb() is returning -EINVAL and the print
> statement is " *****************  URB condition Success**************
> "
> all the above code is being called from completion routine.
> 
> Please let me know if I am doing any mistakes.

Undoubtedly you are doing something wrong.  But we can't tell what 
unless you post the code to your completion routine.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux