summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/es2.c
diff options
context:
space:
mode:
authorAlexandre Bailon <abailon@baylibre.com>2015-09-14 18:20:42 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2015-09-14 22:02:00 -0700
commit1ff3dc920500c2f1cdfaa08c6812f19e05a36da1 (patch)
treed594c386537a195f9d689f58dab9a80eb0af0d64 /drivers/staging/greybus/es2.c
parentb9154df5cfd2d4cc180f425f0b26e095ce1ffdbc (diff)
greybus: es2: rename misnamed variables and methods
Some methods and variables name were a lot confusing. Replace it or add ep_pair in methods or varaibles name to make sources less confusing. Signed-off-by: Alexandre Bailon <abailon@baylibre.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.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
index 96090aaa4181..2ac2c1b433a5 100644
--- a/drivers/staging/greybus/es2.c
+++ b/drivers/staging/greybus/es2.c
@@ -123,7 +123,7 @@ static void cport_out_callback(struct urb *urb);
static void usb_log_enable(struct es1_ap_dev *es1);
static void usb_log_disable(struct es1_ap_dev *es1);
-static int cport_to_ep(struct es1_ap_dev *es1, u16 cport_id)
+static int cport_to_ep_pair(struct es1_ap_dev *es1, u16 cport_id)
{
if (cport_id >= es1->hd->num_cports)
return 0;
@@ -132,38 +132,38 @@ static int cport_to_ep(struct es1_ap_dev *es1, u16 cport_id)
#define ES1_TIMEOUT 500 /* 500 ms for the SVC to do something */
-static int ep_in_use(struct es1_ap_dev *es1, int bulk_ep_set)
+static int ep_pair_in_use(struct es1_ap_dev *es1, int ep_pair)
{
int i;
for (i = 0; i < es1->hd->num_cports; i++) {
- if (es1->cport_to_ep[i] == bulk_ep_set)
+ if (es1->cport_to_ep[i] == ep_pair)
return 1;
}
return 0;
}
int map_cport_to_ep(struct es1_ap_dev *es1,
- u16 cport_id, int bulk_ep_set)
+ u16 cport_id, int ep_pair)
{
int retval;
struct cport_to_ep *cport_to_ep;
- if (bulk_ep_set < 0 || bulk_ep_set >= NUM_BULKS)
+ if (ep_pair < 0 || ep_pair >= NUM_BULKS)
return -EINVAL;
if (cport_id >= es1->hd->num_cports)
return -EINVAL;
- if (bulk_ep_set && ep_in_use(es1, bulk_ep_set))
+ if (ep_pair && ep_pair_in_use(es1, ep_pair))
return -EINVAL;
cport_to_ep = kmalloc(sizeof(*cport_to_ep), GFP_KERNEL);
if (!cport_to_ep)
return -ENOMEM;
- es1->cport_to_ep[cport_id] = bulk_ep_set;
+ es1->cport_to_ep[cport_id] = ep_pair;
cport_to_ep->cport_id = cpu_to_le16(cport_id);
- cport_to_ep->endpoint_in = es1->cport_in[bulk_ep_set].endpoint;
- cport_to_ep->endpoint_out = es1->cport_out[bulk_ep_set].endpoint;
+ cport_to_ep->endpoint_in = es1->cport_in[ep_pair].endpoint;
+ cport_to_ep->endpoint_out = es1->cport_out[ep_pair].endpoint;
retval = usb_control_msg(es1->usb_dev,
usb_sndctrlpipe(es1->usb_dev, 0),
@@ -275,7 +275,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
size_t buffer_size;
int retval;
struct urb *urb;
- int bulk_ep_set;
+ int ep_pair;
unsigned long flags;
/*
@@ -302,10 +302,10 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id,
buffer_size = sizeof(*message->header) + message->payload_size;
- bulk_ep_set = cport_to_ep(es1, cport_id);
+ ep_pair = cport_to_ep_pair(es1, cport_id);
usb_fill_bulk_urb(urb, udev,
usb_sndbulkpipe(udev,
- es1->cport_out[bulk_ep_set].endpoint),
+ es1->cport_out[ep_pair].endpoint),
message->buffer, buffer_size,
cport_out_callback, message);
urb->transfer_flags |= URB_ZERO_PACKET;