greybus: camera-gb: Implement camera module reference counting as subject.
commit17ca677018117deee1bd75b301894dca975e7fc5
authorEvgeniy Borisov <borisov_evgeniy@projectara.com>
Tue, 31 May 2016 08:33:11 +0000 (31 11:33 +0300)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 3 Jun 2016 15:57:48 +0000 (3 08:57 -0700)
treefcb41c3231032986d0baa10016f0d7ed9c81c01f
parent6c5ce637db01c33712db996a78a74b25f3a5e0e3
greybus: camera-gb: Implement camera module reference counting as subject.

In explanation:

The main idea for implementing reference counting is to not block exit
until any other modules are in use. Camera responsibility is to handle
properly any additional calls after camera exit and that what this
patch is doing:

1. Free camera module when reference count is zero.
2. After camera cleanup handle properly any additional ongoing
   transaction. Return error if connection is destroyed.

Signed-off-by: Evgeniy Borisov <eborisov@mm-sol.com>
Reviewed-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/camera.c