summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/es2.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-08-03 14:09:33 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-08-03 15:42:38 +0200
commit121bae2bec47a9944049f2583b1d31f479110f0f (patch)
tree62c57f5952002946f693cb04dfbb45461c359ae7 /drivers/staging/greybus/es2.c
parent4ae2d962637e4a002d1f0884dceec800c79b3ea4 (diff)
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: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/es2.c')
-rw-r--r--drivers/staging/greybus/es2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
index c31124d7defc..8d0e52d46a2b 100644
--- a/drivers/staging/greybus/es2.c
+++ b/drivers/staging/greybus/es2.c
@@ -1184,7 +1184,8 @@ static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload,
unsigned long flags;
int retval;
- *result = 0;
+ if (result)
+ *result = 0;
rpc = arpc_alloc(payload, size, type);
if (!rpc)
@@ -1209,7 +1210,8 @@ static int arpc_sync(struct es2_ap_dev *es2, u8 type, void *payload,
if (rpc->resp->result) {
retval = -EREMOTEIO;
- *result = rpc->resp->result;
+ if (result)
+ *result = rpc->resp->result;
} else {
retval = 0;
}