aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/mod_gadget.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c
index 9a5ac02077b..8c721d86bac 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -787,12 +787,18 @@ static int usbhsg_pipe_disable(struct usbhsg_uep *uep)
787 usbhsg_queue_pop(uep, ureq, -ECONNRESET); 787 usbhsg_queue_pop(uep, ureq, -ECONNRESET);
788 } 788 }
789 789
790 uep->pipe->mod_private = NULL;
791 uep->pipe = NULL;
792
793 return 0; 790 return 0;
794} 791}
795 792
793static void usbhsg_uep_init(struct usbhsg_gpriv *gpriv)
794{
795 int i;
796 struct usbhsg_uep *uep;
797
798 usbhsg_for_each_uep_with_dcp(uep, gpriv, i)
799 uep->pipe = NULL;
800}
801
796/* 802/*
797 * 803 *
798 * usb_ep_ops 804 * usb_ep_ops
@@ -809,6 +815,13 @@ static int usbhsg_ep_enable(struct usb_ep *ep,
809 unsigned long flags; 815 unsigned long flags;
810 int ret = -EIO; 816 int ret = -EIO;
811 817
818 /*
819 * if it already have pipe,
820 * nothing to do
821 */
822 if (uep->pipe)
823 return 0;
824
812 /******************** spin lock ********************/ 825 /******************** spin lock ********************/
813 spin_lock_irqsave(lock, flags); 826 spin_lock_irqsave(lock, flags);
814 827
@@ -1045,6 +1058,7 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status)
1045 * pipe initialize and enable DCP 1058 * pipe initialize and enable DCP
1046 */ 1059 */
1047 usbhs_pipe_init(priv); 1060 usbhs_pipe_init(priv);
1061 usbhsg_uep_init(gpriv);
1048 usbhsg_dcp_enable(dcp); 1062 usbhsg_dcp_enable(dcp);
1049 1063
1050 /* 1064 /*