Returning -EINVAL indicates wrong arguments, but that's not the case
here.
Returning -ENOTTY is also no option, since the ioctl is implemented, but
it just is not valid for this input.
So use -ENODATA instead. This is also used elsewhere when an ioctl isn't
valid for a specific input.
In this case G/S_SELECTION returned -EINVAL for the webcam input. That
input doesn't support cropping, instead it uses ENUM_FRAMESIZES to
enumerate a list of discrete frame sizes.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
if (vivid_is_webcam(dev))
- return -EINVAL;
+ return -ENODATA;
sel->r.left = sel->r.top = 0;
switch (sel->target) {
if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;
if (vivid_is_webcam(dev))
- return -EINVAL;
+ return -ENODATA;
switch (s->target) {
case V4L2_SEL_TGT_CROP: