]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/chipidea/otg_fsm.c
usb: allow to supply the PHY in the drivers when using HCD
[karo-tx-linux.git] / drivers / usb / chipidea / otg_fsm.c
index d8490e758a745df907076d2586b6cf5c52b6bfc6..862d7cb01b9250ab3f46489e7b23ad7cc7f0a817 100644 (file)
@@ -778,20 +778,10 @@ void ci_hdrc_otg_fsm_start(struct ci_hdrc *ci)
 int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)
 {
        int retval = 0;
-       struct usb_otg *otg;
 
-       otg = devm_kzalloc(ci->dev,
-                       sizeof(struct usb_otg), GFP_KERNEL);
-       if (!otg) {
-               dev_err(ci->dev,
-               "Failed to allocate usb_otg structure for ci hdrc otg!\n");
-               return -ENOMEM;
-       }
-
-       otg->usb_phy = ci->transceiver;
-       otg->gadget = &ci->gadget;
-       ci->fsm.otg = otg;
-       ci->transceiver->otg = ci->fsm.otg;
+       ci->otg.usb_phy = ci->usb_phy;
+       ci->otg.gadget = &ci->gadget;
+       ci->fsm.otg = &ci->otg;
        ci->fsm.power_up = 1;
        ci->fsm.id = hw_read_otgsc(ci, OTGSC_ID) ? 1 : 0;
        ci->fsm.otg->state = OTG_STATE_UNDEFINED;