From: Fabio Estevam Date: Mon, 24 Jul 2017 02:10:48 +0000 (-0300) Subject: regulator: pwm-regulator: Remove unneeded gpiod NULL check X-Git-Tag: v4.14-rc1~143^2^2~1^5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a4aae5afc90fba2ca251b1179b58e1de19776605;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 1b88e0e1..a2fd140e 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) { 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; }