drivers/video: Fix returned errno in error cases

When the value that is out of range is specified in ioctl(VIDIOC_S_CTRL) and
ioctl(VIDIOC_S_EXT_CTRLS), returned value should be not EINVAL but ERANGE.
This commit is contained in:
SPRESENSE 2023-07-11 10:48:52 +09:00 committed by Xiang Xiao
parent f04dce1314
commit 4b966aa1e7
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@
#define VALIDATE_VALUE(val, min, max, step) (((val >= min) && \ #define VALIDATE_VALUE(val, min, max, step) (((val >= min) && \
(val <= max) && \ (val <= max) && \
(((val - min) % step) == 0) ? \ (((val - min) % step) == 0) ? \
OK : -EINVAL)) OK : -ERANGE))
#define ISX012_CHIPID_L (0x0000c460) #define ISX012_CHIPID_L (0x0000c460)
#define ISX012_CHIPID_H (0x00005516) #define ISX012_CHIPID_H (0x00005516)

View File

@ -3521,7 +3521,7 @@ static int validate_range(int32_t val,
if (!VALIDATE_RANGE(val, range->minimum, range->maximum, range->step)) if (!VALIDATE_RANGE(val, range->minimum, range->maximum, range->step))
{ {
ret = -EINVAL; ret = -ERANGE;
} }
return ret; return ret;