usb: renesas_usbhs: call usbhsg_queue_pop() when pipe disable.
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 25 Nov 2011 01:28:26 +0000 (17:28 -0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Dec 2011 09:45:19 +0000 (11:45 +0200)
When poping packet from queue, it needs correct end procedure.
This patch call usbhsg_queue_pop() in usbhsg_pipe_disable().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/renesas_usbhs/mod_gadget.c

index 1648406..dba15e0 100644 (file)
@@ -557,14 +557,16 @@ static int usbhsg_pipe_disable(struct usbhsg_uep *uep)
        struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
        struct usbhs_pkt *pkt;
 
-       usbhs_pipe_disable(pipe);
-
        while (1) {
                pkt = usbhs_pkt_pop(pipe, NULL);
                if (!pkt)
                        break;
+
+               usbhsg_queue_pop(uep, usbhsg_pkt_to_ureq(pkt), -ECONNRESET);
        }
 
+       usbhs_pipe_disable(pipe);
+
        return 0;
 }