diff options
-rw-r--r-- | drivers/usb/common/usb-otg-fsm.c | 10 | ||||
-rw-r--r-- | include/linux/usb/otg-fsm.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c index c5d232dc5579..f77571f8b834 100644 --- a/drivers/usb/common/usb-otg-fsm.c +++ b/drivers/usb/common/usb-otg-fsm.c @@ -425,6 +425,7 @@ int otg_hnp_polling(struct otg_fsm *fsm) int retval; enum usb_otg_state state = fsm->otg->state; struct usb_otg_descriptor *desc = NULL; + u8 host_request_flag; if ((state != OTG_STATE_A_HOST || !fsm->b_hnp_enable) && state != OTG_STATE_B_HOST) @@ -460,7 +461,7 @@ int otg_hnp_polling(struct otg_fsm *fsm) } } - fsm->host_req_flag = 0; + *fsm->host_req_flag = 0; /* Get host request flag from connected USB device */ retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), @@ -468,13 +469,14 @@ int otg_hnp_polling(struct otg_fsm *fsm) USB_DIR_IN | USB_RECIP_DEVICE, 0, OTG_STS_SELECTOR, - &fsm->host_req_flag, + fsm->host_req_flag, 1, USB_CTRL_GET_TIMEOUT); if (retval == 1) { - if (fsm->host_req_flag == HOST_REQUEST_FLAG) { + host_request_flag = *fsm->host_req_flag; + if (host_request_flag == HOST_REQUEST_FLAG) { retval = otg_handle_role_switch(fsm, udev); - } else if (fsm->host_req_flag == 0) { + } else if (host_request_flag == 0) { /* Continue polling */ otg_add_timer(fsm, HNP_POLLING); retval = 0; diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h index 89cce2362415..aa5ba16c3d42 100644 --- a/include/linux/usb/otg-fsm.h +++ b/include/linux/usb/otg-fsm.h @@ -140,7 +140,7 @@ struct otg_fsm { /* Current usb protocol used: 0:undefine; 1:host; 2:client */ int protocol; struct mutex lock; - u8 host_req_flag; + u8 *host_req_flag; }; struct otg_fsm_ops { |