diff options
| author | Pawel Laszczak <[email protected]> | 2020-07-13 10:05:52 +0000 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2020-07-24 13:45:13 +0000 |
| commit | 5c2cf30f14cc3973f2d288e33b0153f5d9a357fb (patch) | |
| tree | aa1920de1da2f3f6cb7a36f599fc0856718ec659 /drivers/usb/cdns3/core.c | |
| parent | usb: cdns3: Added CDNS3_ID_PERIPHERAL and CDNS3_ID_HOST (diff) | |
| download | kernel-5c2cf30f14cc3973f2d288e33b0153f5d9a357fb.tar.gz kernel-5c2cf30f14cc3973f2d288e33b0153f5d9a357fb.zip | |
usb: cdns3: core: removed 'goto not_otg'
Patch removes 'goto not_otg' instruction from
cdns3_hw_role_state_machine function.
Signed-off-by: Pawel Laszczak <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/core.c')
| -rw-r--r-- | drivers/usb/cdns3/core.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index c498b585eb13..8e3996f211a8 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -191,11 +191,17 @@ err: */ static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns) { - enum usb_role role; + enum usb_role role = USB_ROLE_NONE; int id, vbus; - if (cdns->dr_mode != USB_DR_MODE_OTG) - goto not_otg; + if (cdns->dr_mode != USB_DR_MODE_OTG) { + if (cdns3_is_host(cdns)) + role = USB_ROLE_HOST; + if (cdns3_is_device(cdns)) + role = USB_ROLE_DEVICE; + + return role; + } id = cdns3_get_id(cdns); vbus = cdns3_get_vbus(cdns); @@ -232,14 +238,6 @@ static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns) dev_dbg(cdns->dev, "role %d -> %d\n", cdns->role, role); return role; - -not_otg: - if (cdns3_is_host(cdns)) - role = USB_ROLE_HOST; - if (cdns3_is_device(cdns)) - role = USB_ROLE_DEVICE; - - return role; } static int cdns3_idle_role_start(struct cdns3 *cdns) |
