diff options
Diffstat (limited to 'drivers/usb/common/usb-otg-fsm.c')
-rw-r--r-- | drivers/usb/common/usb-otg-fsm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c index 7c598489cd86..c1075f4d5d67 100644 --- a/drivers/usb/common/usb-otg-fsm.c +++ b/drivers/usb/common/usb-otg-fsm.c @@ -432,7 +432,6 @@ static int otg_handle_role_switch(struct otg_fsm *fsm, struct usb_device *udev) int otg_hnp_polling(struct otg_fsm *fsm) { struct usb_device *udev; - u8 host_req_flag; int retval; enum usb_otg_state state = fsm->otg->state; struct usb_otg_descriptor *desc = NULL; @@ -471,6 +470,7 @@ int otg_hnp_polling(struct otg_fsm *fsm) } } + fsm->host_req_flag = 0; /* Get host request flag from connected USB device */ retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), @@ -478,13 +478,13 @@ int otg_hnp_polling(struct otg_fsm *fsm) USB_DIR_IN | USB_RECIP_DEVICE, 0, OTG_STS_SELECTOR, - &host_req_flag, + &fsm->host_req_flag, 1, USB_CTRL_GET_TIMEOUT); if (retval == 1) { - if (host_req_flag == HOST_REQUEST_FLAG) { + if (fsm->host_req_flag == HOST_REQUEST_FLAG) { retval = otg_handle_role_switch(fsm, udev); - } else if (host_req_flag == 0) { + } else if (fsm->host_req_flag == 0) { /* Continue polling */ otg_add_timer(fsm, HNP_POLLING); retval = 0; |