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>
This commit is contained in:
parent
9746b11715
commit
c702e2f702
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue