From 35b1342bb040a1e12d82b46ae296f660684a2d23 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Tue, 18 Nov 2014 13:26:49 -0600 Subject: [PATCH] greybus: cancel messages, not gbufs Rework greybus_kill_gbuf() to be oriented toward an operation message rather than a gbuf, and rename it. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/operation.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index d22b927..5d5cce6 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -122,12 +122,12 @@ static int gb_message_send(struct gb_message *message, gfp_t gfp_mask) return 0; } -static void greybus_kill_gbuf(struct gbuf *gbuf) +static void gb_message_cancel(struct gb_message *message) { - if (gbuf->status != -EINPROGRESS) + if (message->gbuf.status != -EINPROGRESS) return; - gbuf->hd->driver->buffer_cancel(gbuf->hcd_data); + message->gbuf.hd->driver->buffer_cancel(message->gbuf.hcd_data); } /* @@ -152,7 +152,7 @@ int gb_operation_wait(struct gb_operation *operation) ret = wait_for_completion_interruptible(&operation->completion); /* If interrupted, cancel the in-flight buffer */ if (ret < 0) - greybus_kill_gbuf(&operation->request.gbuf); + gb_message_cancel(&operation->request); return ret; } @@ -489,9 +489,9 @@ void gb_connection_operation_recv(struct gb_connection *connection, void gb_operation_cancel(struct gb_operation *operation) { operation->canceled = true; - greybus_kill_gbuf(&operation->request.gbuf); + gb_message_cancel(&operation->request); if (operation->response.gbuf.transfer_buffer) - greybus_kill_gbuf(&operation->response.gbuf); + gb_message_cancel(&operation->response); } int gb_operation_init(void) -- 2.7.4