From 2dbcb6fb96f5faca146279d5fc8a3c7b803b25cb Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 17 Jul 2019 05:24:13 -0400 Subject: media: media/i2c: don't return ENOTTY if SUBDEV_API is not set If CONFIG_VIDEO_V4L2_SUBDEV_API is not set, then it is still possible to call set_fmt for V4L2_SUBDEV_FORMAT_TRY, the result is just not stored. So return 0 instead of -ENOTTY. Calling get_fmt with V4L2_SUBDEV_FORMAT_TRY should return -EINVAL instead of -ENOTTY, after all the get_fmt functionality is still present, just not supported for TRY. Signed-off-by: Hans Verkuil Acked-by: Lad, Prabhakar Acked-by: Rui Miguel Silva Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov2640.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/i2c/ov2640.c') diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index ecd167d7c4d2..8fd17661dd78 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -929,7 +929,7 @@ static int ov2640_get_fmt(struct v4l2_subdev *sd, format->format = *mf; return 0; #else - return -ENOTTY; + return -EINVAL; #endif } -- cgit