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(¤t_urb_context->us->pusb_dev_spin_lock, flags); > status = usb_submit_urb(current_urb, GFP_ATOMIC); > spin_unlock_irqrestore(¤t_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