From 53fd070174c48ecb1514819b4c27e0f25cf86c5d Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Dec 2021 19:12:24 +0000 Subject: [PATCH] staging: bcm2835-camera: Disable camera on error If the encode tunnel failed to enable, then the camera was left enabled and that caused a failure on a subsequent request to change format. Disable the camera on failure. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 867edc5d67fc71..d953c77e39a2da 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -554,7 +554,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) vchiq_mmal_port_return_buffers(dev->instance, dev->capture.port, flush_cb); - return -1; + disable_camera(dev); + return -EINVAL; } }