usb: gadget: use config_ep_by_speed() instead of ep_choose()
Remove obsolete functions: 1. ep_choose() 2. usb_find_endpoint() Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
48767a4e82
commit
ea2a1df7b2
@@ -59,8 +59,6 @@ struct f_hidg {
|
||||
struct cdev cdev;
|
||||
struct usb_function func;
|
||||
struct usb_ep *in_ep;
|
||||
struct usb_endpoint_descriptor *fs_in_ep_desc;
|
||||
struct usb_endpoint_descriptor *hs_in_ep_desc;
|
||||
};
|
||||
|
||||
static inline struct f_hidg *func_to_hidg(struct usb_function *f)
|
||||
@@ -425,8 +423,12 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
||||
if (hidg->in_ep->driver_data != NULL)
|
||||
usb_ep_disable(hidg->in_ep);
|
||||
|
||||
hidg->in_ep->desc = ep_choose(f->config->cdev->gadget,
|
||||
hidg->hs_in_ep_desc, hidg->fs_in_ep_desc);
|
||||
status = config_ep_by_speed(f->config->cdev->gadget, f,
|
||||
hidg->in_ep);
|
||||
if (status) {
|
||||
ERROR(cdev, "config_ep_by_speed FAILED!\n");
|
||||
goto fail;
|
||||
}
|
||||
status = usb_ep_enable(hidg->in_ep);
|
||||
if (status < 0) {
|
||||
ERROR(cdev, "Enable endpoint FAILED!\n");
|
||||
@@ -497,21 +499,12 @@ static int __init hidg_bind(struct usb_configuration *c, struct usb_function *f)
|
||||
if (!f->descriptors)
|
||||
goto fail;
|
||||
|
||||
hidg->fs_in_ep_desc = usb_find_endpoint(hidg_fs_descriptors,
|
||||
f->descriptors,
|
||||
&hidg_fs_in_ep_desc);
|
||||
|
||||
if (gadget_is_dualspeed(c->cdev->gadget)) {
|
||||
hidg_hs_in_ep_desc.bEndpointAddress =
|
||||
hidg_fs_in_ep_desc.bEndpointAddress;
|
||||
f->hs_descriptors = usb_copy_descriptors(hidg_hs_descriptors);
|
||||
if (!f->hs_descriptors)
|
||||
goto fail;
|
||||
hidg->hs_in_ep_desc = usb_find_endpoint(hidg_hs_descriptors,
|
||||
f->hs_descriptors,
|
||||
&hidg_hs_in_ep_desc);
|
||||
} else {
|
||||
hidg->hs_in_ep_desc = NULL;
|
||||
}
|
||||
|
||||
mutex_init(&hidg->lock);
|
||||
|
Reference in New Issue
Block a user