diff options
Diffstat (limited to 'drivers/usb/chipidea/otg_fsm.c')
-rw-r--r-- | drivers/usb/chipidea/otg_fsm.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index d8490e758a74..862d7cb01b92 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c | |||
@@ -778,20 +778,10 @@ void ci_hdrc_otg_fsm_start(struct ci_hdrc *ci) | |||
778 | int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci) | 778 | int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci) |
779 | { | 779 | { |
780 | int retval = 0; | 780 | int retval = 0; |
781 | struct usb_otg *otg; | ||
782 | 781 | ||
783 | otg = devm_kzalloc(ci->dev, | 782 | ci->otg.usb_phy = ci->usb_phy; |
784 | sizeof(struct usb_otg), GFP_KERNEL); | 783 | ci->otg.gadget = &ci->gadget; |
785 | if (!otg) { | 784 | ci->fsm.otg = &ci->otg; |
786 | dev_err(ci->dev, | ||
787 | "Failed to allocate usb_otg structure for ci hdrc otg!\n"); | ||
788 | return -ENOMEM; | ||
789 | } | ||
790 | |||
791 | otg->usb_phy = ci->transceiver; | ||
792 | otg->gadget = &ci->gadget; | ||
793 | ci->fsm.otg = otg; | ||
794 | ci->transceiver->otg = ci->fsm.otg; | ||
795 | ci->fsm.power_up = 1; | 785 | ci->fsm.power_up = 1; |
796 | ci->fsm.id = hw_read_otgsc(ci, OTGSC_ID) ? 1 : 0; | 786 | ci->fsm.id = hw_read_otgsc(ci, OTGSC_ID) ? 1 : 0; |
797 | ci->fsm.otg->state = OTG_STATE_UNDEFINED; | 787 | ci->fsm.otg->state = OTG_STATE_UNDEFINED; |