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

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;