summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/es2.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2016-08-17 11:07:28 +0200
committerGreg Kroah-Hartman2016-09-02 14:20:56 +0200
commitb6c1bd3a8e466759fbfd2a649a9058d51ff136c0 (patch)
treed012909559f89e4c44928d72ecd5a652acc8cdec /drivers/staging/greybus/es2.c
parentgreybus: es2: use a single bulk ep pair for all greybus data (diff)
downloadkernel-qcow2-linux-b6c1bd3a8e466759fbfd2a649a9058d51ff136c0.tar.gz
kernel-qcow2-linux-b6c1bd3a8e466759fbfd2a649a9058d51ff136c0.tar.xz
kernel-qcow2-linux-b6c1bd3a8e466759fbfd2a649a9058d51ff136c0.zip
greybus: es2: remove #if 0 code
These functions were never used, and we are about to remove the structures it was trying to reference, so let's remove it to get it out of the way. Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/es2.c')
-rw-r--r--drivers/staging/greybus/es2.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
index 97a33439e4f2..cef651024074 100644
--- a/drivers/staging/greybus/es2.c
+++ b/drivers/staging/greybus/es2.c
@@ -208,65 +208,6 @@ static int cport_to_ep_pair(struct es2_ap_dev *es2, u16 cport_id)
return es2->cport_to_ep[cport_id];
}
-/* Disable for now until we work all of this out to keep a warning-free build */
-#if 0
-/* Test if the endpoints pair is already mapped to a cport */
-static int ep_pair_in_use(struct es2_ap_dev *es2, int ep_pair)
-{
- int i;
-
- for (i = 0; i < es2->hd->num_cports; i++) {
- if (es2->cport_to_ep[i] == ep_pair)
- return 1;
- }
- return 0;
-}
-
-/* Configure the endpoint mapping and send the request to APBridge */
-static int map_cport_to_ep(struct es2_ap_dev *es2,
- u16 cport_id, int ep_pair)
-{
- int retval;
- struct cport_to_ep *cport_to_ep;
-
- if (ep_pair < 0 || ep_pair >= NUM_BULKS)
- return -EINVAL;
- if (cport_id >= es2->hd->num_cports)
- return -EINVAL;
- if (ep_pair && ep_pair_in_use(es2, ep_pair))
- return -EINVAL;
-
- cport_to_ep = kmalloc(sizeof(*cport_to_ep), GFP_KERNEL);
- if (!cport_to_ep)
- return -ENOMEM;
-
- es2->cport_to_ep[cport_id] = ep_pair;
- cport_to_ep->cport_id = cpu_to_le16(cport_id);
- cport_to_ep->endpoint_in = es2->cport_in[ep_pair].endpoint;
- cport_to_ep->endpoint_out = es2->cport_out[ep_pair].endpoint;
-
- retval = usb_control_msg(es2->usb_dev,
- usb_sndctrlpipe(es2->usb_dev, 0),
- GB_APB_REQUEST_EP_MAPPING,
- USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
- 0x00, 0x00,
- (char *)cport_to_ep,
- sizeof(*cport_to_ep),
- ES2_USB_CTRL_TIMEOUT);
- if (retval == sizeof(*cport_to_ep))
- retval = 0;
- kfree(cport_to_ep);
-
- return retval;
-}
-
-/* Unmap a cport: use the muxed endpoints pair */
-static int unmap_cport(struct es2_ap_dev *es2, u16 cport_id)
-{
- return map_cport_to_ep(es2, cport_id, 0);
-}
-#endif
-
static int output_sync(struct es2_ap_dev *es2, void *req, u16 size, u8 cmd)
{
struct usb_device *udev = es2->usb_dev;