brcm2708: update to latest patches from the RPi foundation
[openwrt/staging/lynxis.git] / target / linux / brcm2708 / patches-4.19 / 950-0242-staging-bcm2835-camera-Return-early-on-errors.patch
index 5dc558a7e365f7f5435d82a480065ca26ff047bd..5405a2a338d4303054afa022aa5ef81019379f30 100644 (file)
@@ -1,7 +1,7 @@
-From 83ba21bb6043c5afc3d497e9be4e128b3e1adf93 Mon Sep 17 00:00:00 2001
+From 7270f7555eb3d8144844c110e10f20558e563de6 Mon Sep 17 00:00:00 2001
 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
 Date: Fri, 10 Mar 2017 17:27:56 +0000
-Subject: [PATCH 242/703] staging: bcm2835-camera: Return early on errors
+Subject: [PATCH 242/725] staging: bcm2835-camera: Return early on errors
 
 Fix several instances where it is easier to return
 early on error conditions than handle it as an else
@@ -24,10 +24,10 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
 +
 +      if (length == 0) {
                /* stream ended */
-               if (buf) {
-                       /* this should only ever happen if the port is
-@@ -358,71 +360,72 @@ static void buffer_cb(struct vchiq_mmal_
-                       /* signal frame completion */
+               if (dev->capture.frame_count) {
+                       /* empty buffer whilst capturing - expected to be an
+@@ -361,71 +363,72 @@ static void buffer_cb(struct vchiq_mmal_
+                       vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
                        complete(&dev->capture.frame_cmplt);
                }
 -      } else {
@@ -158,7 +158,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
  }
  
  static int enable_camera(struct bm2835_mmal_dev *dev)
-@@ -802,27 +805,29 @@ static int vidioc_overlay(struct file *f
+@@ -815,27 +818,29 @@ static int vidioc_overlay(struct file *f
  
        ret = vchiq_mmal_port_set_format(dev->instance, src);
        if (ret < 0)