summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-05-28 09:31:52 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-06-07 12:49:23 -0300
commitda3e18059be96c67365e63e4d1e3f301d802c3c8 (patch)
treebdf5a8ed1bd702684fa1353fef1be17918ab06aa /drivers/staging
parent22b2807dae2c79eb9f75a5c0e4cdfd418fd14fcf (diff)
downloadlinux-stable-da3e18059be96c67365e63e4d1e3f301d802c3c8.tar.gz
linux-stable-da3e18059be96c67365e63e4d1e3f301d802c3c8.tar.bz2
linux-stable-da3e18059be96c67365e63e4d1e3f301d802c3c8.zip
[media] staging: atomisp: Ignore errors from second gpio in ov2680 driver
As the existing comment in the driver indicates the sensor has only 1 pin, but some boards may have 2 gpios defined and we toggle both as we we don't know which one is the right one. However if the ACPI resources table defines only 1 gpio (as expected) the gpio1_ctrl call will always fail, causing the probing of the driver to file. This commit ignore the return value of the gpio1_ctrl call, fixing this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/atomisp/i2c/ov2680.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/media/atomisp/i2c/ov2680.c b/drivers/staging/media/atomisp/i2c/ov2680.c
index 449aa2aa276f..6dd466558701 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/ov2680.c
@@ -885,11 +885,12 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
if (flag) {
ret = dev->platform_data->gpio0_ctrl(sd, 1);
usleep_range(10000, 15000);
- ret |= dev->platform_data->gpio1_ctrl(sd, 1);
+ /* Ignore return from second gpio, it may not be there */
+ dev->platform_data->gpio1_ctrl(sd, 1);
usleep_range(10000, 15000);
} else {
- ret = dev->platform_data->gpio1_ctrl(sd, 0);
- ret |= dev->platform_data->gpio0_ctrl(sd, 0);
+ dev->platform_data->gpio1_ctrl(sd, 0);
+ ret = dev->platform_data->gpio0_ctrl(sd, 0);
}
return ret;
}