diff options
author | Tatyana Brokhman <tlinder@codeaurora.org> | 2011-06-28 09:33:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-28 14:14:37 -0400 |
commit | ea2a1df7b2b1de839a72217d85bfb4b7b049010c (patch) | |
tree | 89c10a2a18bba8a1d448b8b1f1281cf52b2287c6 /drivers/usb/gadget/f_subset.c | |
parent | 48767a4e8263620c347c3fa17812c943dd0fc2fa (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget/f_subset.c')
-rw-r--r-- | drivers/usb/gadget/f_subset.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c index aecaed1724a..93bf676ef50 100644 --- a/drivers/usb/gadget/f_subset.c +++ b/drivers/usb/gadget/f_subset.c | |||
@@ -57,18 +57,10 @@ | |||
57 | * caring about specific product and vendor IDs. | 57 | * caring about specific product and vendor IDs. |
58 | */ | 58 | */ |
59 | 59 | ||
60 | struct geth_descs { | ||
61 | struct usb_endpoint_descriptor *in; | ||
62 | struct usb_endpoint_descriptor *out; | ||
63 | }; | ||
64 | |||
65 | struct f_gether { | 60 | struct f_gether { |
66 | struct gether port; | 61 | struct gether port; |
67 | 62 | ||
68 | char ethaddr[14]; | 63 | char ethaddr[14]; |
69 | |||
70 | struct geth_descs fs; | ||
71 | struct geth_descs hs; | ||
72 | }; | 64 | }; |
73 | 65 | ||
74 | static inline struct f_gether *func_to_geth(struct usb_function *f) | 66 | static inline struct f_gether *func_to_geth(struct usb_function *f) |
@@ -243,10 +235,12 @@ static int geth_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
243 | } | 235 | } |
244 | 236 | ||
245 | DBG(cdev, "init + activate cdc subset\n"); | 237 | DBG(cdev, "init + activate cdc subset\n"); |
246 | geth->port.in_ep->desc = ep_choose(cdev->gadget, | 238 | if (config_ep_by_speed(cdev->gadget, f, geth->port.in_ep) || |
247 | geth->hs.in, geth->fs.in); | 239 | config_ep_by_speed(cdev->gadget, f, geth->port.out_ep)) { |
248 | geth->port.out_ep->desc = ep_choose(cdev->gadget, | 240 | geth->port.in_ep->desc = NULL; |
249 | geth->hs.out, geth->fs.out); | 241 | geth->port.out_ep->desc = NULL; |
242 | return -EINVAL; | ||
243 | } | ||
250 | 244 | ||
251 | net = gether_connect(&geth->port); | 245 | net = gether_connect(&geth->port); |
252 | return IS_ERR(net) ? PTR_ERR(net) : 0; | 246 | return IS_ERR(net) ? PTR_ERR(net) : 0; |
@@ -297,12 +291,6 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) | |||
297 | /* copy descriptors, and track endpoint copies */ | 291 | /* copy descriptors, and track endpoint copies */ |
298 | f->descriptors = usb_copy_descriptors(fs_eth_function); | 292 | f->descriptors = usb_copy_descriptors(fs_eth_function); |
299 | 293 | ||
300 | geth->fs.in = usb_find_endpoint(fs_eth_function, | ||
301 | f->descriptors, &fs_subset_in_desc); | ||
302 | geth->fs.out = usb_find_endpoint(fs_eth_function, | ||
303 | f->descriptors, &fs_subset_out_desc); | ||
304 | |||
305 | |||
306 | /* support all relevant hardware speeds... we expect that when | 294 | /* support all relevant hardware speeds... we expect that when |
307 | * hardware is dual speed, all bulk-capable endpoints work at | 295 | * hardware is dual speed, all bulk-capable endpoints work at |
308 | * both speeds | 296 | * both speeds |
@@ -315,11 +303,6 @@ geth_bind(struct usb_configuration *c, struct usb_function *f) | |||
315 | 303 | ||
316 | /* copy descriptors, and track endpoint copies */ | 304 | /* copy descriptors, and track endpoint copies */ |
317 | f->hs_descriptors = usb_copy_descriptors(hs_eth_function); | 305 | f->hs_descriptors = usb_copy_descriptors(hs_eth_function); |
318 | |||
319 | geth->hs.in = usb_find_endpoint(hs_eth_function, | ||
320 | f->hs_descriptors, &hs_subset_in_desc); | ||
321 | geth->hs.out = usb_find_endpoint(hs_eth_function, | ||
322 | f->hs_descriptors, &hs_subset_out_desc); | ||
323 | } | 306 | } |
324 | 307 | ||
325 | /* NOTE: all that is done without knowing or caring about | 308 | /* NOTE: all that is done without knowing or caring about |