Apply e5fd39d9b8
This commit is contained in:
parent
b46e18b807
commit
f361b6ecc1
@ -2965,7 +2965,6 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
|
|||||||
{
|
{
|
||||||
struct fsg_dev *fsg = fsg_from_func(f);
|
struct fsg_dev *fsg = fsg_from_func(f);
|
||||||
struct usb_gadget *gadget = c->cdev->gadget;
|
struct usb_gadget *gadget = c->cdev->gadget;
|
||||||
int rc;
|
|
||||||
int i;
|
int i;
|
||||||
struct usb_ep *ep;
|
struct usb_ep *ep;
|
||||||
|
|
||||||
@ -2991,6 +2990,13 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
|
|||||||
ep->driver_data = fsg->common; /* claim the endpoint */
|
ep->driver_data = fsg->common; /* claim the endpoint */
|
||||||
fsg->bulk_out = ep;
|
fsg->bulk_out = ep;
|
||||||
|
|
||||||
|
/* Copy descriptors */
|
||||||
|
f->descriptors = usb_copy_descriptors(fsg_fs_function);
|
||||||
|
if (unlikely(!f->descriptors)) {
|
||||||
|
usb_free_descriptors(f->descriptors);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
if (gadget_is_dualspeed(gadget)) {
|
if (gadget_is_dualspeed(gadget)) {
|
||||||
/* Assume endpoint addresses are the same for both speeds */
|
/* Assume endpoint addresses are the same for both speeds */
|
||||||
fsg_hs_bulk_in_desc.bEndpointAddress =
|
fsg_hs_bulk_in_desc.bEndpointAddress =
|
||||||
@ -3004,9 +3010,8 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f)
|
|||||||
|
|
||||||
autoconf_fail:
|
autoconf_fail:
|
||||||
ERROR(fsg, "unable to autoconfigure all endpoints\n");
|
ERROR(fsg, "unable to autoconfigure all endpoints\n");
|
||||||
rc = -ENOTSUPP;
|
|
||||||
fsg_unbind(c, f);
|
fsg_unbind(c, f);
|
||||||
return rc;
|
return -ENOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user