regulator: pwm-regulator: Remove unneeded gpiod NULL check
authorFabio Estevam <fabio.estevam@nxp.com>
Mon, 24 Jul 2017 02:10:48 +0000 (23:10 -0300)
committerMark Brown <broonie@kernel.org>
Mon, 24 Jul 2017 15:26:35 +0000 (16:26 +0100)
The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/pwm-regulator.c

index 1b88e0e15a70ce2fed55456c11c57d1ee9a64c69..a2fd140eff81a16272ac7844a8e31fc03fb0a7f0 100644 (file)
@@ -122,8 +122,7 @@ static int pwm_regulator_enable(struct regulator_dev *dev)
 {
        struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev);
 
-       if (drvdata->enb_gpio)
-               gpiod_set_value_cansleep(drvdata->enb_gpio, 1);
+       gpiod_set_value_cansleep(drvdata->enb_gpio, 1);
 
        return pwm_enable(drvdata->pwm);
 }
@@ -134,8 +133,7 @@ static int pwm_regulator_disable(struct regulator_dev *dev)
 
        pwm_disable(drvdata->pwm);
 
-       if (drvdata->enb_gpio)
-               gpiod_set_value_cansleep(drvdata->enb_gpio, 0);
+       gpiod_set_value_cansleep(drvdata->enb_gpio, 0);
 
        return 0;
 }