diff options
author | Fabio Estevam <festevam@gmail.com> | 2019-06-28 07:00:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 13:09:35 +0200 |
commit | 64f3fb5d751c04b4a9555ab148de3446fd2f920f (patch) | |
tree | 73c35ca1eafb9530a2f921dbdf3beacb2f419122 /drivers/media | |
parent | 6cc816dd644e2cd6931eb89b3e1ad99f43444e41 (diff) | |
download | linux-stable-64f3fb5d751c04b4a9555ab148de3446fd2f920f.tar.gz linux-stable-64f3fb5d751c04b4a9555ab148de3446fd2f920f.tar.bz2 linux-stable-64f3fb5d751c04b4a9555ab148de3446fd2f920f.zip |
media: i2c: ov5640: Check for devm_gpiod_get_optional() error
[ Upstream commit 8791a102ce579346cea9d2f911afef1c1985213c ]
The power down and reset GPIO are optional, but the return value
from devm_gpiod_get_optional() needs to be checked and propagated
in the case of error, so that probe deferral can work.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/i2c/ov5640.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index d5c0ffc55d46..a3bbef682fb8 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -2787,9 +2787,14 @@ static int ov5640_probe(struct i2c_client *client, /* request optional power down pin */ sensor->pwdn_gpio = devm_gpiod_get_optional(dev, "powerdown", GPIOD_OUT_HIGH); + if (IS_ERR(sensor->pwdn_gpio)) + return PTR_ERR(sensor->pwdn_gpio); + /* request optional reset pin */ sensor->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(sensor->reset_gpio)) + return PTR_ERR(sensor->reset_gpio); v4l2_i2c_subdev_init(&sensor->sd, client, &ov5640_subdev_ops); |