summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-10-18 03:46:56 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-10-24 23:48:35 +0200
commit61c03b631b74a38ab53753f3ee971a55886d4843 (patch)
tree9c0c44727365b74a1be3058b85bfebf133275b12 /drivers/media
parentmedia: i2c: Add IMX290 CMOS image sensor driver (diff)
downloadlinux-61c03b631b74a38ab53753f3ee971a55886d4843.tar.xz
linux-61c03b631b74a38ab53753f3ee971a55886d4843.zip
media: st-mipid02: add a check for devm_gpiod_get_optional
mipid02_probe misses a check for devm_gpiod_get_optional and may miss the failure. Add a check to fix the problem. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/st-mipid02.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
index 81285b8d5cfb..003ba22334cd 100644
--- a/drivers/media/i2c/st-mipid02.c
+++ b/drivers/media/i2c/st-mipid02.c
@@ -971,6 +971,11 @@ static int mipid02_probe(struct i2c_client *client)
bridge->reset_gpio = devm_gpiod_get_optional(dev, "reset",
GPIOD_OUT_HIGH);
+ if (IS_ERR(bridge->reset_gpio)) {
+ dev_err(dev, "failed to get reset GPIO\n");
+ return PTR_ERR(bridge->reset_gpio);
+ }
+
ret = mipid02_get_regulators(bridge);
if (ret) {
dev_err(dev, "failed to get regulators %d", ret);