drivers/video: Return 0 in case g_video_sensor_ops or get_supported_value is NULL

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-12-05 03:27:48 +08:00 committed by Petro Karashchenko
parent e002edf87c
commit c8868b3745

View File

@ -779,7 +779,9 @@ static int32_t get_default_value(uint32_t id)
if ((g_video_sensor_ops == NULL) || if ((g_video_sensor_ops == NULL) ||
(g_video_sensor_ops->get_supported_value == 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); ret = g_video_sensor_ops->get_supported_value(id, &value);