You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/12/05 09:35:33 UTC

[nuttx] 01/04: drivers/video: Return 0 in case g_video_sensor_ops or get_supported_value is NULL

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit c8868b374573ed90f84065e393b8761159401d15
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Dec 5 03:27:48 2022 +0800

    drivers/video: Return 0 in case g_video_sensor_ops or get_supported_value is NULL
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/video/video.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/video.c b/drivers/video/video.c
index c797e3e1bb..69adee9a68 100644
--- a/drivers/video/video.c
+++ b/drivers/video/video.c
@@ -779,7 +779,9 @@ static int32_t get_default_value(uint32_t id)
   if ((g_video_sensor_ops == NULL) ||
       (g_video_sensor_ops->get_supported_value == NULL))
     {
-      return -EINVAL;
+      /* Don't care(unsupported parameter) */
+
+      return 0;
     }
 
   ret = g_video_sensor_ops->get_supported_value(id, &value);