From a4a6a63dab133da3f156cb773be98a603d6da558 Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Tue, 23 Jun 2015 16:04:57 +0800 Subject: [PATCH] MLK-11151 usb: chipidea: otg: drive vbus off if fsm.drv_vbus is true The current condition may not true even we have driven vbus on already. The vbus drive operation may be async, eg through i2c gpio expendor, so the vbus may not be valid when we unload usb module. We meet this issue when we do fast load/unload usb module test. Signed-off-by: Peter Chen (cherry picked from commit c0cdff8472c38e0fc39c597148d5534a5e9cc9b1) --- drivers/usb/chipidea/otg_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index cfbb82ff57b0..72a565bc9ef1 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c @@ -942,7 +942,7 @@ void ci_hdrc_otg_fsm_remove(struct ci_hdrc *ci) ci->enabled_otg_timer_bits = 0; /* Turn off vbus if vbus is on */ - if (ci->fsm.a_vbus_vld) + if (ci->fsm.drv_vbus) otg_drv_vbus(&ci->fsm, 0); sysfs_remove_group(&ci->dev->kobj, &inputs_attr_group); -- 2.17.1