greybus: cancel messages, not gbufs
authorAlex Elder <elder@linaro.org>
Tue, 18 Nov 2014 19:26:49 +0000 (13:26 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 18 Nov 2014 20:50:34 +0000 (12:50 -0800)
Rework greybus_kill_gbuf() to be oriented toward an operation
message rather than a gbuf, and rename it.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c

index d22b927..5d5cce6 100644 (file)
@@ -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)