greybus: camera: Early update num_streams and flags
authorJacopo Mondi <jacopo.mondi@linaro.org>
Thu, 30 Jun 2016 14:18:00 +0000 (09:18 -0500)
committerAlex Elder <elder@linaro.org>
Wed, 6 Jul 2016 02:18:00 +0000 (21:18 -0500)
commit7f93eab7c705527b0579b1bfd4d6e9f6acc9e5ca
treec640e83cd0c9ca817a0ae2292c3a50327f17dbc7
parente65579e335da0a65b5a76a343ddff6a6f3c77dd1
greybus: camera: Early update num_streams and flags

In configure_streams Operation, when returning from the greybus
operation call, we can assign the num_streams and flags variable earlier
so that if the following stream configuration inspection fails, the
caller receives the right number of configured streams anyway

Testing Done: White camera module preview and capture.
              Triggering failure during stream configuration inspection
              makes configuration fails, but avoid segfaulting as
              was previously happening

Signed-off-by: Jacopo Mondi <jacopo.mondi@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Alex Elder <elder@linaro.org>
drivers/staging/greybus/camera.c