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

greybus: send messages, not gbufs

Rework greybus_submit_gbuf() to be oriented toward an operation
message rather than a gbuf, and rename it accordingly.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 6a70736a
...@@ -103,17 +103,21 @@ gb_pending_operation_find(struct gb_connection *connection, u16 id) ...@@ -103,17 +103,21 @@ gb_pending_operation_find(struct gb_connection *connection, u16 id)
return found ? operation : NULL; return found ? operation : NULL;
} }
static int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask) static int gb_message_send(struct gb_message *message, gfp_t gfp_mask)
{ {
gbuf->status = -EINPROGRESS; struct greybus_host_device *hd = message->gbuf.hd;
gbuf->hcd_data = gbuf->hd->driver->buffer_send(gbuf->hd,
gbuf->dest_cport_id, gbuf->transfer_buffer, message->gbuf.status = -EINPROGRESS;
gbuf->transfer_buffer_length, gfp_mask); message->gbuf.hcd_data = hd->driver->buffer_send(hd,
if (IS_ERR(gbuf->hcd_data)) { message->gbuf.dest_cport_id,
gbuf->status = PTR_ERR(gbuf->hcd_data); message->gbuf.transfer_buffer,
gbuf->hcd_data = NULL; message->gbuf.transfer_buffer_length,
gfp_mask);
return gbuf->status; if (IS_ERR(message->gbuf.hcd_data)) {
message->gbuf.status = PTR_ERR(message->gbuf.hcd_data);
message->gbuf.hcd_data = NULL;
return message->gbuf.status;
} }
return 0; return 0;
} }
...@@ -390,7 +394,7 @@ int gb_operation_request_send(struct gb_operation *operation, ...@@ -390,7 +394,7 @@ int gb_operation_request_send(struct gb_operation *operation,
*/ */
operation->callback = callback; operation->callback = callback;
gb_pending_operation_insert(operation); gb_pending_operation_insert(operation);
ret = greybus_submit_gbuf(&operation->request.gbuf, GFP_KERNEL); ret = gb_message_send(&operation->request, GFP_KERNEL);
if (ret) if (ret)
return ret; return ret;
......
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