greybus: add a reference to pending operations
authorAlex Elder <elder@linaro.org>
Sat, 22 Nov 2014 01:29:15 +0000 (19:29 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Sat, 22 Nov 2014 03:36:42 +0000 (19:36 -0800)
commitdeb4b9efb30606b8cb1150b8ae1e922405f60f8d
tree06794622807c975c5d4da6c95b64e3cd889f77a2
parent583c3117a4d36499adfe6de186826d59f5c4d788
greybus: add a reference to pending operations

Grab an extra reference to an operation before sending it.  Drop
that reference at the end of its completion handling.

It turns out gb_operation_get() got deleted along the way, so this
re-introduces it.  We're assuming we only get a reference when
there's at least one in existence so we don't need a semaphore to
protect it.  Emphasize this by *not* returning a pointer to
the referenced operation.

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