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_ncm.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_ncm.c')
-rw-r--r-- | drivers/usb/gadget/f_ncm.c | 49 |
1 files changed, 15 insertions, 34 deletions
diff --git a/drivers/usb/gadget/f_ncm.c b/drivers/usb/gadget/f_ncm.c index 06daa1bc9ffd..ae69ed7e6b99 100644 --- a/drivers/usb/gadget/f_ncm.c +++ b/drivers/usb/gadget/f_ncm.c | |||
@@ -48,12 +48,6 @@ | |||
48 | #define NCM_NDP_HDR_CRC 0x01000000 | 48 | #define NCM_NDP_HDR_CRC 0x01000000 |
49 | #define NCM_NDP_HDR_NOCRC 0x00000000 | 49 | #define NCM_NDP_HDR_NOCRC 0x00000000 |
50 | 50 | ||
51 | struct ncm_ep_descs { | ||
52 | struct usb_endpoint_descriptor *in; | ||
53 | struct usb_endpoint_descriptor *out; | ||
54 | struct usb_endpoint_descriptor *notify; | ||
55 | }; | ||
56 | |||
57 | enum ncm_notify_state { | 51 | enum ncm_notify_state { |
58 | NCM_NOTIFY_NONE, /* don't notify */ | 52 | NCM_NOTIFY_NONE, /* don't notify */ |
59 | NCM_NOTIFY_CONNECT, /* issue CONNECT next */ | 53 | NCM_NOTIFY_CONNECT, /* issue CONNECT next */ |
@@ -66,9 +60,6 @@ struct f_ncm { | |||
66 | 60 | ||
67 | char ethaddr[14]; | 61 | char ethaddr[14]; |
68 | 62 | ||
69 | struct ncm_ep_descs fs; | ||
70 | struct ncm_ep_descs hs; | ||
71 | |||
72 | struct usb_ep *notify; | 63 | struct usb_ep *notify; |
73 | struct usb_request *notify_req; | 64 | struct usb_request *notify_req; |
74 | u8 notify_state; | 65 | u8 notify_state; |
@@ -801,11 +792,12 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
801 | if (ncm->notify->driver_data) { | 792 | if (ncm->notify->driver_data) { |
802 | DBG(cdev, "reset ncm control %d\n", intf); | 793 | DBG(cdev, "reset ncm control %d\n", intf); |
803 | usb_ep_disable(ncm->notify); | 794 | usb_ep_disable(ncm->notify); |
804 | } else { | 795 | } |
796 | |||
797 | if (!(ncm->notify->desc)) { | ||
805 | DBG(cdev, "init ncm ctrl %d\n", intf); | 798 | DBG(cdev, "init ncm ctrl %d\n", intf); |
806 | ncm->notify->desc = ep_choose(cdev->gadget, | 799 | if (config_ep_by_speed(cdev->gadget, f, ncm->notify)) |
807 | ncm->hs.notify, | 800 | goto fail; |
808 | ncm->fs.notify); | ||
809 | } | 801 | } |
810 | usb_ep_enable(ncm->notify); | 802 | usb_ep_enable(ncm->notify); |
811 | ncm->notify->driver_data = ncm; | 803 | ncm->notify->driver_data = ncm; |
@@ -828,14 +820,17 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) | |||
828 | if (alt == 1) { | 820 | if (alt == 1) { |
829 | struct net_device *net; | 821 | struct net_device *net; |
830 | 822 | ||
831 | if (!ncm->port.in_ep->desc) { | 823 | if (!ncm->port.in_ep->desc || |
824 | !ncm->port.out_ep->desc) { | ||
832 | DBG(cdev, "init ncm\n"); | 825 | DBG(cdev, "init ncm\n"); |
833 | ncm->port.in_ep->desc = ep_choose(cdev->gadget, | 826 | if (config_ep_by_speed(cdev->gadget, f, |
834 | ncm->hs.in, | 827 | ncm->port.in_ep) || |
835 | ncm->fs.in); | 828 | config_ep_by_speed(cdev->gadget, f, |
836 | ncm->port.out_ep->desc = ep_choose(cdev->gadget, | 829 | ncm->port.out_ep)) { |
837 | ncm->hs.out, | 830 | ncm->port.in_ep->desc = NULL; |
838 | ncm->fs.out); | 831 | ncm->port.out_ep->desc = NULL; |
832 | goto fail; | ||
833 | } | ||
839 | } | 834 | } |
840 | 835 | ||
841 | /* TODO */ | 836 | /* TODO */ |
@@ -1227,13 +1222,6 @@ ncm_bind(struct usb_configuration *c, struct usb_function *f) | |||
1227 | if (!f->descriptors) | 1222 | if (!f->descriptors) |
1228 | goto fail; | 1223 | goto fail; |
1229 | 1224 | ||
1230 | ncm->fs.in = usb_find_endpoint(ncm_fs_function, | ||
1231 | f->descriptors, &fs_ncm_in_desc); | ||
1232 | ncm->fs.out = usb_find_endpoint(ncm_fs_function, | ||
1233 | f->descriptors, &fs_ncm_out_desc); | ||
1234 | ncm->fs.notify = usb_find_endpoint(ncm_fs_function, | ||
1235 | f->descriptors, &fs_ncm_notify_desc); | ||
1236 | |||
1237 | /* | 1225 | /* |
1238 | * support all relevant hardware speeds... we expect that when | 1226 | * support all relevant hardware speeds... we expect that when |
1239 | * hardware is dual speed, all bulk-capable endpoints work at | 1227 | * hardware is dual speed, all bulk-capable endpoints work at |
@@ -1251,13 +1239,6 @@ ncm_bind(struct usb_configuration *c, struct usb_function *f) | |||
1251 | f->hs_descriptors = usb_copy_descriptors(ncm_hs_function); | 1239 | f->hs_descriptors = usb_copy_descriptors(ncm_hs_function); |
1252 | if (!f->hs_descriptors) | 1240 | if (!f->hs_descriptors) |
1253 | goto fail; | 1241 | goto fail; |
1254 | |||
1255 | ncm->hs.in = usb_find_endpoint(ncm_hs_function, | ||
1256 | f->hs_descriptors, &hs_ncm_in_desc); | ||
1257 | ncm->hs.out = usb_find_endpoint(ncm_hs_function, | ||
1258 | f->hs_descriptors, &hs_ncm_out_desc); | ||
1259 | ncm->hs.notify = usb_find_endpoint(ncm_hs_function, | ||
1260 | f->hs_descriptors, &hs_ncm_notify_desc); | ||
1261 | } | 1242 | } |
1262 | 1243 | ||
1263 | /* | 1244 | /* |