Franck Bui-Huu wrote:
>       /* wait for the completion of the URB */
> -     wait_for_completion(&urb_done);
> -     clear_bit(US_FLIDX_URB_ACTIVE, &us->flags);
> +     timeout = wait_for_completion_interruptible_timeout(
> +                     &urb_done, timeout ? : MAX_SCHEDULE_TIMEOUT);
>   
> -     /* clean up the timeout timer */
> -     if (timeout > 0)
> -             del_timer_sync(&to_timer);
> +     if (test_and_clear_bit(US_FLIDX_URB_ACTIVE, &us->flags) && timeout <= 
> 0) {

Thinking more about it, I'm wondering it the second condition (timeout <= 0)
is really needed. Do you think so ?


> +             US_DEBUGP("%s -- cancelling URB\n",
> +                       timeout == 0 ? "Timeout" : "Signal");
> +             usb_unlink_urb(us->current_urb);
> +     }
>  
>       /* return the URB status */
>       return us->current_urb->status;



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to