[libcamera-devel,v7,4/8] libcamera: v4l2_device: Propagate releaseBuffers() error

Message ID 20190417135858.23914-5-jacopo@jmondi.org
State Accepted
Headers show
Series
  • libcamera: Framework changes to prepare for multiple streams support
Related show

Commit Message

Jacopo Mondi April 17, 2019, 1:58 p.m. UTC
The error code returned by requestBuffers(0) was not propagated to the
caller. Fix it.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/v4l2_device.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Niklas Söderlund April 17, 2019, 3:36 p.m. UTC | #1
Hi Jacopo,

Thanks for your work.

On 2019-04-17 15:58:54 +0200, Jacopo Mondi wrote:
> The error code returned by requestBuffers(0) was not propagated to the
> caller. Fix it.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/v4l2_device.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index 4cc4a6d656b1..d394632dad4c 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -737,10 +737,9 @@ int V4L2Device::releaseBuffers()
>  {
>  	LOG(V4L2, Debug) << "Releasing bufferPool";
>  
> -	requestBuffers(0);
>  	bufferPool_ = nullptr;
>  
> -	return 0;
> +	return requestBuffers(0);
>  }
>  
>  /**
> -- 
> 2.21.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart April 18, 2019, 12:49 p.m. UTC | #2
Hi Jacopo,

Thank you for the patch.

On Wed, Apr 17, 2019 at 03:58:54PM +0200, Jacopo Mondi wrote:
> The error code returned by requestBuffers(0) was not propagated to the
> caller. Fix it.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/v4l2_device.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index 4cc4a6d656b1..d394632dad4c 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -737,10 +737,9 @@ int V4L2Device::releaseBuffers()
>  {
>  	LOG(V4L2, Debug) << "Releasing bufferPool";
>  
> -	requestBuffers(0);
>  	bufferPool_ = nullptr;
>  
> -	return 0;
> +	return requestBuffers(0);
>  }
>  
>  /**

Patch

diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 4cc4a6d656b1..d394632dad4c 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -737,10 +737,9 @@  int V4L2Device::releaseBuffers()
 {
 	LOG(V4L2, Debug) << "Releasing bufferPool";
 
-	requestBuffers(0);
 	bufferPool_ = nullptr;
 
-	return 0;
+	return requestBuffers(0);
 }
 
 /**