summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2019-04-03 11:08:39 +0200
committerMarco Felsch <m.felsch@pengutronix.de>2019-04-03 12:29:50 +0200
commitf7a1578195593cf638656ae2d592297ad77a0856 (patch)
tree41c52499f91db0e914083471e4e102c999169eb2
parenta9c9f301eb7794abe625b446283e975ea64d1287 (diff)
downloadlinux-0-day-f7a1578195593cf638656ae2d592297ad77a0856.tar.gz
linux-0-day-f7a1578195593cf638656ae2d592297ad77a0856.tar.xz
media: ov2659: get rid of extra ifdefs
We can drop the ifdef dance since the v4l2_subdev_get_try_format return the correct value in both cases with or without CONFIG_VIDEO_V4L2_SUBDEV_API is enabled. The patch is based on Lubomir's series [1]. [1] https://patchwork.kernel.org/cover/10703017/ Cc: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
-rw-r--r--drivers/media/i2c/ov2659.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 799acce803fe..1c9cbd43f903 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1046,17 +1046,16 @@ static int ov2659_get_fmt(struct v4l2_subdev *sd,
dev_dbg(&client->dev, "ov2659_get_fmt\n");
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
struct v4l2_mbus_framefmt *mf;
mf = v4l2_subdev_get_try_format(sd, cfg, 0);
+ if (IS_ERR(mf))
+ return PTR_ERR(mf);
+
mutex_lock(&ov2659->lock);
fmt->format = *mf;
mutex_unlock(&ov2659->lock);
return 0;
-#else
- return -ENOTTY;
-#endif
}
mutex_lock(&ov2659->lock);
@@ -1126,12 +1125,12 @@ static int ov2659_set_fmt(struct v4l2_subdev *sd,
mutex_lock(&ov2659->lock);
if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
+ if (IS_ERR(mf)) {
+ mutex_unlock(&ov2659->lock);
+ return PTR_ERR(mf);
+ }
*mf = fmt->format;
-#else
- return -ENOTTY;
-#endif
} else {
s64 val;