]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/gadget/legacy/tcm_usb_gadget.c
Merge remote-tracking branch 'target-updates/for-next'
[karo-tx-linux.git] / drivers / usb / gadget / legacy / tcm_usb_gadget.c
index 33833fe2e163122f912d62a0022c6a45f927791a..22e56158d5850236242375d036f70250b676dac7 100644 (file)
@@ -2012,14 +2012,6 @@ static struct usb_configuration usbg_config_driver = {
        .bmAttributes           = USB_CONFIG_ATT_SELFPOWER,
 };
 
-static void give_back_ep(struct usb_ep **pep)
-{
-       struct usb_ep *ep = *pep;
-       if (!ep)
-               return;
-       ep->driver_data = NULL;
-}
-
 static int usbg_bind(struct usb_configuration *c, struct usb_function *f)
 {
        struct f_uas            *fu = to_f_uas(f);
@@ -2039,29 +2031,24 @@ static int usbg_bind(struct usb_configuration *c, struct usb_function *f)
                        &uasp_bi_ep_comp_desc);
        if (!ep)
                goto ep_fail;
-
-       ep->driver_data = fu;
        fu->ep_in = ep;
 
        ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_bo_desc,
                        &uasp_bo_ep_comp_desc);
        if (!ep)
                goto ep_fail;
-       ep->driver_data = fu;
        fu->ep_out = ep;
 
        ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_status_desc,
                        &uasp_status_in_ep_comp_desc);
        if (!ep)
                goto ep_fail;
-       ep->driver_data = fu;
        fu->ep_status = ep;
 
        ep = usb_ep_autoconfig_ss(gadget, &uasp_ss_cmd_desc,
                        &uasp_cmd_comp_desc);
        if (!ep)
                goto ep_fail;
-       ep->driver_data = fu;
        fu->ep_cmd = ep;
 
        /* Assume endpoint addresses are the same for both speeds */
@@ -2085,11 +2072,6 @@ static int usbg_bind(struct usb_configuration *c, struct usb_function *f)
        return 0;
 ep_fail:
        pr_err("Can't claim all required eps\n");
-
-       give_back_ep(&fu->ep_in);
-       give_back_ep(&fu->ep_out);
-       give_back_ep(&fu->ep_status);
-       give_back_ep(&fu->ep_cmd);
        return -ENOTSUPP;
 }