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_serial.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_serial.c')
-rw-r--r-- | drivers/usb/gadget/f_serial.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/usb/gadget/f_serial.c b/drivers/usb/gadget/f_serial.c index a9ce6261d156..91fdf790ed20 100644 --- a/drivers/usb/gadget/f_serial.c +++ b/drivers/usb/gadget/f_serial.c | |||
@@ -27,18 +27,10 @@ | |||
27 | * if you can arrange appropriate host side drivers. | 27 | * if you can arrange appropriate host side drivers. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | struct gser_descs { | ||
31 | struct usb_endpoint_descriptor *in; | ||
32 | struct usb_endpoint_descriptor *out; | ||
33 | }; | ||
34 | |||
35 | struct f_gser { | 30 | struct f_gser { |
36 | struct gserial port; | 31 | struct gserial port; |
37 | u8 data_id; | 32 | u8 data_id; |
38 | u8 port_num; | 33 | u8 port_num; |
39 | |||
40 | struct gser_descs fs; | ||
41 | struct gser_descs hs; | ||
42 | }; | 34 | }; |
43 | 35 | ||
44 | static inline struct f_gser *func_to_gser(struct usb_function *f) | 36 | static inline struct f_gser *func_to_gser(struct usb_function *f) |
@@ -136,12 +128,15 @@ static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
136 | if (gser->port.in->driver_data) { | 128 | if (gser->port.in->driver_data) { |
137 | DBG(cdev, "reset generic ttyGS%d\n", gser->port_num); | 129 | DBG(cdev, "reset generic ttyGS%d\n", gser->port_num); |
138 | gserial_disconnect(&gser->port); | 130 | gserial_disconnect(&gser->port); |
139 | } else { | 131 | } |
132 | if (!gser->port.in->desc || !gser->port.out->desc) { | ||
140 | DBG(cdev, "activate generic ttyGS%d\n", gser->port_num); | 133 | DBG(cdev, "activate generic ttyGS%d\n", gser->port_num); |
141 | gser->port.in->desc = ep_choose(cdev->gadget, | 134 | if (!config_ep_by_speed(cdev->gadget, f, gser->port.in) || |
142 | gser->hs.in, gser->fs.in); | 135 | !config_ep_by_speed(cdev->gadget, f, gser->port.out)) { |
143 | gser->port.out->desc = ep_choose(cdev->gadget, | 136 | gser->port.in->desc = NULL; |
144 | gser->hs.out, gser->fs.out); | 137 | gser->port.out->desc = NULL; |
138 | return -EINVAL; | ||
139 | } | ||
145 | } | 140 | } |
146 | gserial_connect(&gser->port, gser->port_num); | 141 | gserial_connect(&gser->port, gser->port_num); |
147 | return 0; | 142 | return 0; |
@@ -193,12 +188,6 @@ gser_bind(struct usb_configuration *c, struct usb_function *f) | |||
193 | /* copy descriptors, and track endpoint copies */ | 188 | /* copy descriptors, and track endpoint copies */ |
194 | f->descriptors = usb_copy_descriptors(gser_fs_function); | 189 | f->descriptors = usb_copy_descriptors(gser_fs_function); |
195 | 190 | ||
196 | gser->fs.in = usb_find_endpoint(gser_fs_function, | ||
197 | f->descriptors, &gser_fs_in_desc); | ||
198 | gser->fs.out = usb_find_endpoint(gser_fs_function, | ||
199 | f->descriptors, &gser_fs_out_desc); | ||
200 | |||
201 | |||
202 | /* support all relevant hardware speeds... we expect that when | 191 | /* support all relevant hardware speeds... we expect that when |
203 | * hardware is dual speed, all bulk-capable endpoints work at | 192 | * hardware is dual speed, all bulk-capable endpoints work at |
204 | * both speeds | 193 | * both speeds |
@@ -211,11 +200,6 @@ gser_bind(struct usb_configuration *c, struct usb_function *f) | |||
211 | 200 | ||
212 | /* copy descriptors, and track endpoint copies */ | 201 | /* copy descriptors, and track endpoint copies */ |
213 | f->hs_descriptors = usb_copy_descriptors(gser_hs_function); | 202 | f->hs_descriptors = usb_copy_descriptors(gser_hs_function); |
214 | |||
215 | gser->hs.in = usb_find_endpoint(gser_hs_function, | ||
216 | f->hs_descriptors, &gser_hs_in_desc); | ||
217 | gser->hs.out = usb_find_endpoint(gser_hs_function, | ||
218 | f->hs_descriptors, &gser_hs_out_desc); | ||
219 | } | 203 | } |
220 | 204 | ||
221 | DBG(cdev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n", | 205 | DBG(cdev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n", |