OSDN Git Service

greybus: first operation error prevails
authorAlex Elder <elder@linaro.org>
Tue, 25 Nov 2014 17:33:14 +0000 (11:33 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 25 Nov 2014 21:18:16 +0000 (13:18 -0800)
commitabe9a3006fd95d34e69617b65824613e503b9b77
treee24def8173fa866e02f03b6a0dcc8b31068c4272
parentba986b5ab97f59669cc5d174a8a7359b8600e2e5
greybus: first operation error prevails

If an operation already has an error result recorded, don't
overwrite it with a new error code.

In order to ensure a request completes exactly once, return a
Boolean indicating whether setting the result was successful.  If
two threads are racing to complete an operation (for example if a
slow-but-normal response message arrives at the same time timeout
processing commences) only the one that sets the final result
will finish its activity.

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