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>