greybus: operation: refactor response handling
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 27 Mar 2015 11:45:49 +0000 (12:45 +0100)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 30 Mar 2015 13:20:34 +0000 (15:20 +0200)
commit973ccfd62686a2331f43b0053de052d958f50d31
tree64bac22afe54717e27c9dcd738421713db87b193
parentd0eb755aeef092f27b3dd2a4c90616f613541f56
greybus: operation: refactor response handling

Send response to incoming requests from the operation request handler
rather than in every protocol request_recv callback.

This simplifies request_recv error handling and allows for further code
reuse.

Note that if we ever get protocols that need to hold off sending
responses we could implement this by letting them return a special
value (after acquiring the necessary operation references) to suppress
the response from being sent by greybus core.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/gpio.c
drivers/staging/greybus/hid.c
drivers/staging/greybus/operation.c
drivers/staging/greybus/protocol.h