From: Li Jun <b47...@freescale.com>

Cleare the flag after try to do role switch, no matter the role switch succeeds
or not.

Signed-off-by: Li Jun <jun...@freescale.com>
---
 drivers/usb/common/usb-otg-fsm.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
index 1cd8995..e677b1e 100644
--- a/drivers/usb/common/usb-otg-fsm.c
+++ b/drivers/usb/common/usb-otg-fsm.c
@@ -78,6 +78,8 @@ static void otg_leave_state(struct otg_fsm *fsm, enum 
usb_otg_state old_state)
                fsm->b_srp_done = 0;
                break;
        case OTG_STATE_B_PERIPHERAL:
+               if (fsm->otg->gadget)
+                       fsm->otg->gadget->host_request_flag = 0;
                break;
        case OTG_STATE_B_WAIT_ACON:
                otg_del_timer(fsm, B_ASE0_BRST);
@@ -107,6 +109,8 @@ static void otg_leave_state(struct otg_fsm *fsm, enum 
usb_otg_state old_state)
        case OTG_STATE_A_PERIPHERAL:
                otg_del_timer(fsm, A_BIDL_ADIS);
                fsm->a_bidl_adis_tmout = 0;
+               if (fsm->otg->gadget)
+                       fsm->otg->gadget->host_request_flag = 0;
                break;
        case OTG_STATE_A_WAIT_VFALL:
                otg_del_timer(fsm, A_WAIT_VFALL);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to