]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: ov5640: Make the return rate type more explicit
authorMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 3 Dec 2018 08:44:24 +0000 (03:44 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 5 Dec 2018 11:49:43 +0000 (06:49 -0500)
In the ov5640_try_frame_interval function, the ret variable actually holds
the frame rate index to use, which is represented by the enum
ov5640_frame_rate in the driver.

Make it more obvious.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Tested-by: Adam Ford <aford173@gmail.com> #imx6dq
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov5640.c

index abca08d669be788ada24c818499b4f3d235029ae..6cdf5ee0e4fa6a0cdbba13dfd776a35485ad9364 100644 (file)
@@ -2052,8 +2052,8 @@ static int ov5640_try_frame_interval(struct ov5640_dev *sensor,
                                     u32 width, u32 height)
 {
        const struct ov5640_mode_info *mode;
+       enum ov5640_frame_rate rate = OV5640_30_FPS;
        u32 minfps, maxfps, fps;
-       int ret;
 
        minfps = ov5640_framerates[OV5640_15_FPS];
        maxfps = ov5640_framerates[OV5640_30_FPS];
@@ -2076,10 +2076,10 @@ static int ov5640_try_frame_interval(struct ov5640_dev *sensor,
        else
                fi->denominator = minfps;
 
-       ret = (fi->denominator == minfps) ? OV5640_15_FPS : OV5640_30_FPS;
+       rate = (fi->denominator == minfps) ? OV5640_15_FPS : OV5640_30_FPS;
 
-       mode = ov5640_find_mode(sensor, ret, width, height, false);
-       return mode ? ret : -EINVAL;
+       mode = ov5640_find_mode(sensor, rate, width, height, false);
+       return mode ? rate : -EINVAL;
 }
 
 static int ov5640_get_fmt(struct v4l2_subdev *sd,