Skip to content

Commit a4aae5a

Browse files
Fabio Estevambroonie
authored andcommitted
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 760068b commit a4aae5a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/regulator/pwm-regulator.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ static int pwm_regulator_enable(struct regulator_dev *dev)
122122
{
123123
struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev);
124124

125-
if (drvdata->enb_gpio)
126-
gpiod_set_value_cansleep(drvdata->enb_gpio, 1);
125+
gpiod_set_value_cansleep(drvdata->enb_gpio, 1);
127126

128127
return pwm_enable(drvdata->pwm);
129128
}
@@ -134,8 +133,7 @@ static int pwm_regulator_disable(struct regulator_dev *dev)
134133

135134
pwm_disable(drvdata->pwm);
136135

137-
if (drvdata->enb_gpio)
138-
gpiod_set_value_cansleep(drvdata->enb_gpio, 0);
136+
gpiod_set_value_cansleep(drvdata->enb_gpio, 0);
139137

140138
return 0;
141139
}

0 commit comments

Comments
 (0)