]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: i2c: mt9v111: fix incorrect type for ret
authorQianfeng Rong <rongqianfeng@vivo.com>
Wed, 27 Aug 2025 12:39:10 +0000 (20:39 +0800)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 9 Sep 2025 13:59:16 +0000 (15:59 +0200)
Change "ret" from unsigned int to int type in mt9v111_calc_frame_rate()
to store negative error codes or zero returned by __mt9v111_hw_reset()
and other functions.

Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but it's ugly as pants.

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Fixes: aab7ed1c3927 ("media: i2c: Add driver for Aptina MT9V111")
Cc: stable@vger.kernel.org
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/mt9v111.c

index 6aa80b504168d00887c684c3aa7d153310d58d45..9d724a7cd2f560eeb7b799d5025ff2e4b0078f80 100644 (file)
@@ -532,8 +532,8 @@ static int mt9v111_calc_frame_rate(struct mt9v111_dev *mt9v111,
 static int mt9v111_hw_config(struct mt9v111_dev *mt9v111)
 {
        struct i2c_client *c = mt9v111->client;
-       unsigned int ret;
        u16 outfmtctrl2;
+       int ret;
 
        /* Force device reset. */
        ret = __mt9v111_hw_reset(mt9v111);