Commit e01134eb authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Lee Jones

backlight: pwm_bl: Remove unneeded checks for valid GPIOs

All of gpiod_set_value_cansleep() and gpiod_direction_output() handle
NULL GPIO pointers just fine, so there is no need to check for that in
the caller.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/00be8237e0e2bc9b179177b5490f175d657261a2.1684856337.git.geert+renesas@glider.beSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 29554f2e
......@@ -54,8 +54,7 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb)
if (pb->post_pwm_on_delay)
msleep(pb->post_pwm_on_delay);
if (pb->enable_gpio)
gpiod_set_value_cansleep(pb->enable_gpio, 1);
gpiod_set_value_cansleep(pb->enable_gpio, 1);
pb->enabled = true;
}
......@@ -65,8 +64,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb)
if (!pb->enabled)
return;
if (pb->enable_gpio)
gpiod_set_value_cansleep(pb->enable_gpio, 0);
gpiod_set_value_cansleep(pb->enable_gpio, 0);
if (pb->pwm_off_delay)
msleep(pb->pwm_off_delay);
......@@ -429,8 +427,7 @@ static int pwm_backlight_initial_power_state(const struct pwm_bl_data *pb)
* Synchronize the enable_gpio with the observed state of the
* hardware.
*/
if (pb->enable_gpio)
gpiod_direction_output(pb->enable_gpio, active);
gpiod_direction_output(pb->enable_gpio, active);
/*
* Do not change pb->enabled here! pb->enabled essentially
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment