]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
usb: renesas_usbhs: send packet in necessary timing.
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 25 Nov 2011 01:28:17 +0000 (17:28 -0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Dec 2011 09:45:18 +0000 (11:45 +0200)
Current renesas_usbhs driver always tries to send packet in end of recip handler.
But it breaks chapter 9 EndpointHalt test.
This patch fixup this issue.

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 812960ba95e15efd1a01b3d36e68f487c7b0ab5e..16484060a24c75e9c2dc55b6bc876b01f75e2bf3 100644 (file)
@@ -271,6 +271,8 @@ static int usbhsg_recip_handler_std_clear_endpoint(struct usbhs_priv *priv,
 
        usbhsg_recip_handler_std_control_done(priv, uep, ctrl);
 
+       usbhs_pkt_start(pipe);
+
        return 0;
 }
 
@@ -424,8 +426,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
        pipe = usbhsg_uep_to_pipe(uep);
        if (!pipe) {
                dev_err(dev, "wrong recip request\n");
-               ret = -EINVAL;
-               goto usbhsg_recip_run_handle_end;
+               return -EINVAL;
        }
 
        switch (recip) {
@@ -452,9 +453,6 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
                ret = func(priv, uep, ctrl);
        }
 
-usbhsg_recip_run_handle_end:
-       usbhs_pkt_start(pipe);
-
        return ret;
 }