]> git.karo-electronics.de Git - karo-tx-linux.git/commit
greybus: use special operation result valus
authorAlex Elder <elder@linaro.org>
Tue, 25 Nov 2014 17:33:15 +0000 (11:33 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 25 Nov 2014 21:18:16 +0000 (13:18 -0800)
commit3deb37d4ad04c6cb18564f5af2c88c10fa6bfc76
treedd1673f5a7a6549993e0a55c54aab9d49f4e8367
parentabe9a3006fd95d34e69617b65824613e503b9b77
greybus: use special operation result valus

This is more or less re-implementing this commit:
    96f95d4 greybus: update gbuf status for completion handlers
But this time we're doing this for an operation, not the gbuf.

Define an initial operation result value (-EBADR) to signify that no
valid result has been set.  Nobody should ever set that value after
the operation is initially created.  Since only the operation core
code sets the result, an attempt to set -EBADR would be a bug.

Define another known operation result value (-EINPROGRESS) for an
outgoing operation whose request has been sent but whose response
has not yet been successfully received.  This should the first
(non-initial) result value set, and it should happen exactly once.
Any other attempt to set this value once set would be a bug.

Finally, once the request message is in flight, the result value
will be set exactly once more, to indicate the final result of
the operation.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c