OSDN Git Service

greybus: operation: add support for incoming unidirectional operations
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 26 May 2015 13:29:18 +0000 (15:29 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 26 May 2015 22:25:17 +0000 (15:25 -0700)
Add support for incoming, unidirectional operations where the sender of
a request does not care about a response.

Unidirectional operations have an operation id of 0.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/operation.c

index f595b97..4f7a555 100644 (file)
@@ -686,6 +686,10 @@ int gb_operation_response_send(struct gb_operation *operation, int errno)
                return -EIO;    /* Shouldn't happen */
        }
 
+       /* Sender of request does not care about response. */
+       if (!operation->id)
+               return 0;
+
        if (!operation->response) {
                if (!gb_operation_response_alloc(operation, 0)) {
                        dev_err(&connection->dev,