On Wed, Mar 20, 2013 at 11:26:46PM +0100, Michael Grzeschik wrote:
> Signed-off-by: Michael Grzeschik <[email protected]>
> ---
>  drivers/usb/chipidea/udc.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
> index 0c09542..13e3658 100644
> --- a/drivers/usb/chipidea/udc.c
> +++ b/drivers/usb/chipidea/udc.c
> @@ -520,10 +520,12 @@ static int _hardware_dequeue(struct ci13xxx_ep *mEp, 
> struct ci13xxx_req *mReq)
>       else if ((TD_STATUS_TR_ERR & mReq->req.status) != 0)
>               mReq->req.status = -1;
>  
> +     if (mReq->req.status)
> +             return mReq->req.status;
> +
>       mReq->req.actual   = tmptoken & TD_TOTAL_BYTES;
>       mReq->req.actual >>= __ffs(TD_TOTAL_BYTES);
>       mReq->req.actual   = mReq->req.length - mReq->req.actual;
> -     mReq->req.actual   = mReq->req.status ? 0 : mReq->req.actual;
>  
>       return mReq->req.actual;
>  }
> @@ -787,8 +789,10 @@ __acquires(mEp->lock)
>       list_for_each_entry_safe(mReq, mReqTemp, &mEp->qh.queue,
>                       queue) {
>               retval = _hardware_dequeue(mEp, mReq);
> -             if (retval < 0)
> +             if (retval == -EBUSY) {
> +                     retval = 0;
>                       break;
> +             }
>               list_del_init(&mReq->queue);
>               trace_ci_ep_complete_req(mEp, readl(&mReq->ptr->token), retval);
>               if (mReq->req.complete != NULL) {
> @@ -801,8 +805,6 @@ __acquires(mEp->lock)
>               }
>       }
>  
> -     if (retval == -EBUSY)
> -             retval = 0;
>       if (retval < 0)
>               trace_ci_ep_complete_req(mEp, mReq->ptr->token, retval);
>  
> -- 
> 1.8.2.rc2

I just realised that this patch was not for that series. Beside its
broken, as the other cases where (retval < 0) do not break the loop.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to