Commit 121bae2b authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: es2: allow ARPC result to be ignored

Allow user of ARPC to pass a NULL pointer for the ARPC result.

For simple requests there may only be one error code for remote errors,
or the caller may simply not care to differentiate them.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 4ae2d962
......@@ -1184,6 +1184,7 @@ static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload,
unsigned long flags;
int retval;
if (result)
*result = 0;
rpc = arpc_alloc(payload, size, type);
......@@ -1209,6 +1210,7 @@ static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload,
if (rpc->resp->result) {
retval = -EREMOTEIO;
if (result)
*result = rpc->resp->result;
} else {
retval = 0;
......
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