]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
media: staging: atomisp: Do not set GPIO twice
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 27 Sep 2017 18:25:00 +0000 (14:25 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Oct 2017 10:20:12 +0000 (06:20 -0400)
gpiod_get() configures GPIO line at the time of successful request.
Thus, no need to do this explicitly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c

index 8c6a26eea0956d31d901cf3adac1199d1d656902..704d66b83106d2119edbc5b92fd3de4c817c0c23 100644 (file)
@@ -409,21 +409,11 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
        if (!ret)
                clk_disable_unprepare(gmin_subdevs[i].pmc_clk);
 
-       if (!IS_ERR(gmin_subdevs[i].gpio0)) {
-               ret = gpiod_direction_output(gmin_subdevs[i].gpio0, 0);
-               if (ret)
-                       dev_err(dev, "gpio0 set output failed: %d\n", ret);
-       } else {
+       if (IS_ERR(gmin_subdevs[i].gpio0))
                gmin_subdevs[i].gpio0 = NULL;
-       }
 
-       if (!IS_ERR(gmin_subdevs[i].gpio1)) {
-               ret = gpiod_direction_output(gmin_subdevs[i].gpio1, 0);
-               if (ret)
-                       dev_err(dev, "gpio1 set output failed: %d\n", ret);
-       } else {
+       if (IS_ERR(gmin_subdevs[i].gpio1))
                gmin_subdevs[i].gpio1 = NULL;
-       }
 
        if (pmic_id == PMIC_REGULATOR) {
                gmin_subdevs[i].v1p8_reg = regulator_get(dev, "V1P8SX");