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

greybus: set result in gb_operation_response_send()

Change gb_operation_response_send() so it takes an errno to assign
as an operation's result.  This emphasizes that setting the result
should be the last thing done to an incoming operation before
sending its response.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 0cffcac3
......@@ -642,8 +642,13 @@ int gb_operation_request_send(struct gb_operation *operation,
/*
* Send a response for an incoming operation request.
*/
int gb_operation_response_send(struct gb_operation *operation)
int gb_operation_response_send(struct gb_operation *operation, int errno)
{
/* Record the result */
if (!gb_operation_result_set(operation, errno)) {
pr_err("request result already set\n");
return -EIO; /* Shouldn't happen */
}
gb_operation_destroy(operation);
return 0;
......
......@@ -100,7 +100,7 @@ static inline void gb_operation_destroy(struct gb_operation *operation)
int gb_operation_request_send(struct gb_operation *operation,
gb_operation_callback callback);
int gb_operation_response_send(struct gb_operation *operation);
int gb_operation_response_send(struct gb_operation *operation, int errno);
void gb_operation_cancel(struct gb_operation *operation, int errno);
......
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