[libcamera-devel,4/9] libcamera: device_enumerator: Downgrade skipped device errors to warnings

Message ID 20190103013110.6849-4-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,1/9] libcamera: camera_manager: Remove put() method
Related show

Commit Message

Laurent Pinchart Jan. 3, 2019, 1:31 a.m. UTC
When a device is skipped by the udev-based enumerator a message is
logged. Downgrade its severity to warning as the error isn't fatal.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/device_enumerator.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Niklas Söderlund Jan. 3, 2019, 9:21 p.m. UTC | #1
Hi Laurent,

Thanks for your work.

On 2019-01-03 03:31:05 +0200, Laurent Pinchart wrote:
> When a device is skipped by the udev-based enumerator a message is
> logged. Downgrade its severity to warning as the error isn't fatal.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/libcamera/device_enumerator.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
> index 7eef450e0c65..bc55a12f2a4e 100644
> --- a/src/libcamera/device_enumerator.cpp
> +++ b/src/libcamera/device_enumerator.cpp
> @@ -302,8 +302,8 @@ int DeviceEnumeratorUdev::enumerate()
>  
>  		dev = udev_device_new_from_syspath(udev_, syspath);
>  		if (!dev) {
> -			LOG(Error) << "Failed to get device for '" <<
> -				   syspath << "', skipping";
> +			LOG(Warning) << "Failed to get device for '" <<
> +				syspath << "', skipping";
>  			continue;
>  		}
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
index 7eef450e0c65..bc55a12f2a4e 100644
--- a/src/libcamera/device_enumerator.cpp
+++ b/src/libcamera/device_enumerator.cpp
@@ -302,8 +302,8 @@  int DeviceEnumeratorUdev::enumerate()
 
 		dev = udev_device_new_from_syspath(udev_, syspath);
 		if (!dev) {
-			LOG(Error) << "Failed to get device for '" <<
-				   syspath << "', skipping";
+			LOG(Warning) << "Failed to get device for '" <<
+				syspath << "', skipping";
 			continue;
 		}