diff options
author | Fabio Estevam <fabio.estevam@nxp.com> | 2017-07-23 22:10:48 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-07-24 11:26:35 -0400 |
commit | a4aae5afc90fba2ca251b1179b58e1de19776605 (patch) | |
tree | 07469266a602c5d002d4e9b4b84cb44cd658de23 | |
parent | 760068be07c744a4355a0387be4dcd4127ad2523 (diff) |
regulator: pwm-regulator: Remove unneeded gpiod NULL check
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>
-rw-r--r-- | drivers/regulator/pwm-regulator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 1b88e0e15a70..a2fd140eff81 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c | |||
@@ -122,8 +122,7 @@ static int pwm_regulator_enable(struct regulator_dev *dev) | |||
122 | { | 122 | { |
123 | struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); | 123 | struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); |
124 | 124 | ||
125 | if (drvdata->enb_gpio) | 125 | gpiod_set_value_cansleep(drvdata->enb_gpio, 1); |
126 | gpiod_set_value_cansleep(drvdata->enb_gpio, 1); | ||
127 | 126 | ||
128 | return pwm_enable(drvdata->pwm); | 127 | return pwm_enable(drvdata->pwm); |
129 | } | 128 | } |
@@ -134,8 +133,7 @@ static int pwm_regulator_disable(struct regulator_dev *dev) | |||
134 | 133 | ||
135 | pwm_disable(drvdata->pwm); | 134 | pwm_disable(drvdata->pwm); |
136 | 135 | ||
137 | if (drvdata->enb_gpio) | 136 | gpiod_set_value_cansleep(drvdata->enb_gpio, 0); |
138 | gpiod_set_value_cansleep(drvdata->enb_gpio, 0); | ||
139 | 137 | ||
140 | return 0; | 138 | return 0; |
141 | } | 139 | } |