summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2021-02-08 12:32:29 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-02-09 15:14:02 +0100
commitc702e2f70275dbc5373aef50c450cf9c5730636c (patch)
tree6c40e111ef90fa2c4143d512a12dc72caa054550 /drivers/media
parent9746b11715c3949241e2d88cb9057da4adab7e02 (diff)
media: imx334: 'ret' is uninitialized, should have been PTR_ERR()
Fix this compiler warning: drivers/media/i2c/imx334.c: In function 'imx334_parse_hw_config': include/linux/dev_printk.h:112:2: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] 112 | _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__) | ^~~~~~~~ drivers/media/i2c/imx334.c:783:6: note: 'ret' was declared here 783 | int ret; | ^~~ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/imx334.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
index 07e31bc2ef18..ad530f0d338a 100644
--- a/drivers/media/i2c/imx334.c
+++ b/drivers/media/i2c/imx334.c
@@ -790,7 +790,8 @@ static int imx334_parse_hw_config(struct imx334 *imx334)
imx334->reset_gpio = devm_gpiod_get_optional(imx334->dev, "reset",
GPIOD_OUT_LOW);
if (IS_ERR(imx334->reset_gpio)) {
- dev_err(imx334->dev, "failed to get reset gpio %d", ret);
+ dev_err(imx334->dev, "failed to get reset gpio %ld",
+ PTR_ERR(imx334->reset_gpio));
return PTR_ERR(imx334->reset_gpio);
}