diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index 78e9e4a1db2e..e3684299b9f3 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -53,7 +53,7 @@ static int svc_msg_send(struct svc_msg *svc_msg, struct greybus_host_device *hd) // FIXME - Do we need to do more than just pass it to the hd and then // free it? - retval = hd->driver->send_svc_msg(svc_msg, hd); + retval = hd->driver->submit_svc(svc_msg, hd); svc_msg_free(svc_msg); return retval; @@ -294,7 +294,7 @@ static void ap_process_event(struct work_struct *work) kfree(ap_msg); } -int gb_new_ap_msg(u8 *data, int size, struct greybus_host_device *hd) +int greybus_svc_in(u8 *data, int size, struct greybus_host_device *hd) { struct ap_msg *ap_msg; @@ -326,7 +326,7 @@ int gb_new_ap_msg(u8 *data, int size, struct greybus_host_device *hd) return 0; } -EXPORT_SYMBOL_GPL(gb_new_ap_msg); +EXPORT_SYMBOL_GPL(greybus_svc_in); int gb_ap_init(void) { diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 05217c630ff7..a240a92c267a 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -315,7 +315,7 @@ static int create_cport(struct greybus_module *gmod, if (!gmod_cport) return -ENOMEM; - gmod_cport->number = le16_to_cpu(cport->number); + gmod_cport->id = le16_to_cpu(cport->id); gmod_cport->size = le16_to_cpu(cport->size); gmod_cport->speed = cport->speed; diff --git a/drivers/staging/greybus/es1-ap-usb.c b/drivers/staging/greybus/es1-ap-usb.c index 7ce3a7743e58..b6ab12450cd6 100644 --- a/drivers/staging/greybus/es1-ap-usb.c +++ b/drivers/staging/greybus/es1-ap-usb.c @@ -113,7 +113,7 @@ static int alloc_gbuf_data(struct gbuf *gbuf, unsigned int size, gfp_t gfp_mask) * we will encode the cport number in the first byte of the buffer, so * set the second byte to be the "transfer buffer" */ - buffer[0] = gbuf->cport->number; + buffer[0] = gbuf->cport->id; gbuf->transfer_buffer = &buffer[1]; gbuf->transfer_buffer_length = size; gbuf->actual_length = size; @@ -139,7 +139,7 @@ static void free_gbuf_data(struct gbuf *gbuf) } #define ES1_TIMEOUT 500 /* 500 ms for the SVC to do something */ -static int send_svc_msg(struct svc_msg *svc_msg, struct greybus_host_device *hd) +static int submit_svc(struct svc_msg *svc_msg, struct greybus_host_device *hd) { struct es1_ap_dev *es1 = hd_to_es1(hd); int retval; @@ -223,7 +223,7 @@ static struct greybus_host_driver es1_driver = { .hd_priv_size = sizeof(struct es1_ap_dev), .alloc_gbuf_data = alloc_gbuf_data, .free_gbuf_data = free_gbuf_data, - .send_svc_msg = send_svc_msg, + .submit_svc = submit_svc, .submit_gbuf = submit_gbuf, }; @@ -268,7 +268,7 @@ static void svc_in_callback(struct urb *urb) /* We have a message, create a new message structure, add it to the * list, and wake up our thread that will process the messages. */ - gb_new_ap_msg(urb->transfer_buffer, urb->actual_length, es1->hd); + greybus_svc_in(urb->transfer_buffer, urb->actual_length, es1->hd); exit: /* resubmit the urb to get more messages */ @@ -307,7 +307,7 @@ static void cport_in_callback(struct urb *urb) data = &data[1]; /* Pass this data to the greybus core */ - greybus_cport_in_data(es1->hd, cport, data, urb->actual_length - 1); + greybus_cport_in(es1->hd, cport, data, urb->actual_length - 1); exit: /* put our urb back in the request pool */ diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index 46896e829af0..94c2d6acb491 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -156,36 +156,36 @@ static struct gb_cport_handler cport_handler[MAX_CPORTS]; // need it, we don't have a dynamic system... int gb_register_cport_complete(struct greybus_module *gmod, - gbuf_complete_t handler, int cport, + gbuf_complete_t handler, int cport_id, void *context) { - if (cport_handler[cport].handler) + if (cport_handler[cport_id].handler) return -EINVAL; - cport_handler[cport].context = context; - cport_handler[cport].gmod = gmod; - cport_handler[cport].cport.number = cport; - cport_handler[cport].handler = handler; + cport_handler[cport_id].context = context; + cport_handler[cport_id].gmod = gmod; + cport_handler[cport_id].cport.id = cport_id; + cport_handler[cport_id].handler = handler; return 0; } -void gb_deregister_cport_complete(int cport) +void gb_deregister_cport_complete(int cport_id) { - cport_handler[cport].handler = NULL; + cport_handler[cport_id].handler = NULL; } -void greybus_cport_in_data(struct greybus_host_device *hd, int cport, u8 *data, +void greybus_cport_in(struct greybus_host_device *hd, int cport_id, u8 *data, size_t length) { struct gb_cport_handler *ch; struct gbuf *gbuf; /* first check to see if we have a cport handler for this cport */ - ch = &cport_handler[cport]; + ch = &cport_handler[cport_id]; if (!ch->handler) { /* Ugh, drop the data on the floor, after logging it... */ dev_err(hd->parent, "Received data for cport %d, but no handler!\n", - cport); + cport_id); return; } @@ -216,7 +216,7 @@ void greybus_cport_in_data(struct greybus_host_device *hd, int cport, u8 *data, queue_work(gbuf_workqueue, &gbuf->event); } -EXPORT_SYMBOL_GPL(greybus_cport_in_data); +EXPORT_SYMBOL_GPL(greybus_cport_in); /* Can be called in interrupt context, do the work and get out of here */ void greybus_gbuf_finished(struct gbuf *gbuf) diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 87e6218d88db..794822066c7b 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -91,9 +91,9 @@ Submit a SVC message to the hardware the host controller function send_svc_msg is called Receive gbuf messages - the host controller driver must call greybus_cport_in_data() with the data + the host controller driver must call greybus_cport_in() with the data Reveive SVC messages from the hardware - The host controller driver must call gb_new_ap_msg + The host controller driver must call greybus_svc_in */ @@ -102,7 +102,7 @@ struct gbuf; struct gmod_cport { - u16 number; + u16 id; u16 size; u8 speed; // valid??? // FIXME, what else? @@ -169,7 +169,7 @@ struct greybus_host_driver { int (*alloc_gbuf_data)(struct gbuf *gbuf, unsigned int size, gfp_t gfp_mask); void (*free_gbuf_data)(struct gbuf *gbuf); - int (*send_svc_msg)(struct svc_msg *svc_msg, + int (*submit_svc)(struct svc_msg *svc_msg, struct greybus_host_device *hd); int (*submit_gbuf)(struct gbuf *gbuf, struct greybus_host_device *hd, gfp_t gfp_mask); @@ -187,7 +187,7 @@ struct greybus_host_device { struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *host_driver, struct device *parent); void greybus_remove_hd(struct greybus_host_device *hd); -void greybus_cport_in_data(struct greybus_host_device *hd, int cport, u8 *data, +void greybus_cport_in(struct greybus_host_device *hd, int cport_id, u8 *data, size_t length); void greybus_gbuf_finished(struct gbuf *gbuf); @@ -289,7 +289,7 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id, u8 *data, int size); void gb_remove_module(struct greybus_host_device *hd, u8 module_id); -int gb_new_ap_msg(u8 *data, int length, struct greybus_host_device *hd); +int greybus_svc_in(u8 *data, int length, struct greybus_host_device *hd); int gb_ap_init(void); void gb_ap_exit(void); int gb_debugfs_init(void); @@ -298,9 +298,9 @@ int gb_gbuf_init(void); void gb_gbuf_exit(void); int gb_register_cport_complete(struct greybus_module *gmod, - gbuf_complete_t handler, int cport, + gbuf_complete_t handler, int cport_id, void *context); -void gb_deregister_cport_complete(int cport); +void gb_deregister_cport_complete(int cport_id); extern const struct attribute_group *greybus_module_groups[]; diff --git a/drivers/staging/greybus/greybus_manifest.h b/drivers/staging/greybus/greybus_manifest.h index f1f323704107..6f019fa8f4ca 100644 --- a/drivers/staging/greybus/greybus_manifest.h +++ b/drivers/staging/greybus/greybus_manifest.h @@ -70,7 +70,7 @@ struct greybus_descriptor_string { }; struct greybus_descriptor_cport { - __le16 number; + __le16 id; __le16 size; __u8 speed; // FIXME __u8 reserved; diff --git a/drivers/staging/greybus/test_sink.c b/drivers/staging/greybus/test_sink.c index 9dbf6eeba8a6..8b254e3fb037 100644 --- a/drivers/staging/greybus/test_sink.c +++ b/drivers/staging/greybus/test_sink.c @@ -16,9 +16,9 @@ struct test_device { }; int gb_register_cport_complete(struct greybus_module *gmod, - gbuf_complete_t handler, int cport, + gbuf_complete_t handler, int cport_id, void *context); -void gb_deregister_cport_complete(int cport); +void gb_deregister_cport_complete(int cport_id); diff --git a/drivers/staging/greybus/uart-gb.c b/drivers/staging/greybus/uart-gb.c index 2021f2775e22..7735a045da69 100644 --- a/drivers/staging/greybus/uart-gb.c +++ b/drivers/staging/greybus/uart-gb.c @@ -34,7 +34,7 @@ struct gb_tty { struct tty_port port; struct greybus_module *gmod; - int cport; + int cport_id; unsigned int minor; unsigned char clocal; unsigned int throttled:1;