Commit c41f1651 authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: tidy up svc_in_callback() and cport_in_callback()

The only use of local variable "es1" in in svc_in_callback() and
cport_in_callback() is to get at its hd field.  But we already have
that, so we can get rid of that local variable.

Also, rename the "cport" variable "cport_id" in cport_in_callback()
is to match the convention used elsewhere, and make it the proper
u16 type.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 2292bac5
...@@ -346,7 +346,6 @@ static void ap_disconnect(struct usb_interface *interface) ...@@ -346,7 +346,6 @@ static void ap_disconnect(struct usb_interface *interface)
static void svc_in_callback(struct urb *urb) static void svc_in_callback(struct urb *urb)
{ {
struct greybus_host_device *hd = urb->context; struct greybus_host_device *hd = urb->context;
struct es1_ap_dev *es1 = hd_to_es1(hd);
struct device *dev = &urb->dev->dev; struct device *dev = &urb->dev->dev;
int status = check_urb_status(urb); int status = check_urb_status(urb);
int retval; int retval;
...@@ -361,7 +360,7 @@ static void svc_in_callback(struct urb *urb) ...@@ -361,7 +360,7 @@ static void svc_in_callback(struct urb *urb)
/* We have a message, create a new message structure, add it to the /* We have a message, create a new message structure, add it to the
* list, and wake up our thread that will process the messages. * list, and wake up our thread that will process the messages.
*/ */
greybus_svc_in(es1->hd, urb->transfer_buffer, urb->actual_length); greybus_svc_in(hd, urb->transfer_buffer, urb->actual_length);
exit: exit:
/* resubmit the urb to get more messages */ /* resubmit the urb to get more messages */
...@@ -373,11 +372,10 @@ static void svc_in_callback(struct urb *urb) ...@@ -373,11 +372,10 @@ static void svc_in_callback(struct urb *urb)
static void cport_in_callback(struct urb *urb) static void cport_in_callback(struct urb *urb)
{ {
struct greybus_host_device *hd = urb->context; struct greybus_host_device *hd = urb->context;
struct es1_ap_dev *es1 = hd_to_es1(hd);
struct device *dev = &urb->dev->dev; struct device *dev = &urb->dev->dev;
int status = check_urb_status(urb); int status = check_urb_status(urb);
int retval; int retval;
u8 cport; u16 cport_id;
u8 *data; u8 *data;
if (status) { if (status) {
...@@ -398,11 +396,11 @@ static void cport_in_callback(struct urb *urb) ...@@ -398,11 +396,11 @@ static void cport_in_callback(struct urb *urb)
* the stream is "real" data * the stream is "real" data
*/ */
data = urb->transfer_buffer; data = urb->transfer_buffer;
cport = data[0]; cport_id = (u16)data[0];
data = &data[1]; data = &data[1];
/* Pass this data to the greybus core */ /* Pass this data to the greybus core */
greybus_cport_in(es1->hd, cport, data, urb->actual_length - 1); greybus_cport_in(hd, cport_id, data, urb->actual_length - 1);
exit: exit:
/* put our urb back in the request pool */ /* put our urb back in the request pool */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment