diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-07-01 12:37:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-07-01 16:50:59 -0700 |
commit | e3398811c3c3b90501ca67c5de683953efe6cdde (patch) | |
tree | d6d4b52b817830cd0679ee9c985b2b987616e63e /drivers/staging/greybus/operation.c | |
parent | 710067e2ef42473c823fc8176ca9536b1a42c491 (diff) |
greybus: operation: add unidirectional-operation flag
Add flag to identify unidirectional operations.
Use convenience helper rather than open coding the identification when
suppressing response messages.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r-- | drivers/staging/greybus/operation.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index ad0959985aa3..b32010ba7bc1 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -500,6 +500,9 @@ gb_operation_create_incoming(struct gb_connection *connection, u16 id, /* Caller has made sure we at least have a message header. */ request_size = size - sizeof(struct gb_operation_msg_hdr); + if (!id) + flags |= GB_OPERATION_FLAG_UNIDIRECTIONAL; + operation = gb_operation_create_common(connection, type, request_size, 0, flags, GFP_ATOMIC); if (operation) { @@ -666,7 +669,7 @@ static int gb_operation_response_send(struct gb_operation *operation, } /* Sender of request does not care about response. */ - if (!operation->id) + if (gb_operation_is_unidirectional(operation)) return 0; if (!operation->response) { |