diff options
author | Bibek Basu <bbasu@nvidia.com> | 2013-07-02 11:59:19 +0530 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2013-07-11 16:23:03 -0700 |
commit | 8ea5c18bcf972531850ccfa21241b377ec7c4307 (patch) | |
tree | 45fca13c8ff70ffcbd07957c3a226197a9c1319f | |
parent | b258d9754147ef0637f73cc37fdf9c7f1d671ec5 (diff) |
media: video: tegra: correct gpio access
Read and write to gpios only when request for the gpio
has suceeded
Bug 1317541
Change-Id: Icfeed36b9e95f4ee03e49bee0cc8b3c2daf4a4a8
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/244190
(cherry picked from commit 1caddafdf260e3521804a02395d42f3f96928b99)
Reviewed-on: http://git-master/r/245281
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r-- | drivers/media/video/tegra/ov9772.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/tegra/ov9772.c b/drivers/media/video/tegra/ov9772.c index 9b6041baed29..9a312b8c489b 100644 --- a/drivers/media/video/tegra/ov9772.c +++ b/drivers/media/video/tegra/ov9772.c @@ -922,7 +922,7 @@ static int ov9772_gpio_rd(struct ov9772_info *info, { int val = -EINVAL; - if (info->gpio[type].gpio) { + if (info->gpio[type].gpio && info->gpio[type].own) { val = gpio_get_value_cansleep(info->gpio[type].gpio); dev_dbg(&info->i2c_client->dev, "%s %u %d\n", __func__, info->gpio[type].gpio, val); @@ -939,7 +939,7 @@ static int ov9772_gpio_wr(struct ov9772_info *info, { int err = -EINVAL; - if (info->gpio[type].gpio) { + if (info->gpio[type].gpio && info->gpio[type].own) { if (!info->gpio[type].active_high) val = !val; val &= 1; |