Skip to content

Commit

Permalink
backlight: gpio_backlight: Drop output GPIO direction check for initi…
Browse files Browse the repository at this point in the history
…al power state

So, let's drop output GPIO direction check and only check GPIO value to set
the initial power state.

Fixes: 706dc68 ("backlight: gpio: Explicitly set the direction of the GPIO")
Signed-off-by: Liu Ying <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Bartosz Golaszewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
Ying Liu authored and lag-linaro committed Jul 28, 2023
1 parent 5145531 commit fe1328b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/video/backlight/gpio_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
/* Not booted with device tree or no phandle link to the node */
bl->props.power = def_value ? FB_BLANK_UNBLANK
: FB_BLANK_POWERDOWN;
else if (gpiod_get_direction(gbl->gpiod) == 0 &&
gpiod_get_value_cansleep(gbl->gpiod) == 0)
else if (gpiod_get_value_cansleep(gbl->gpiod) == 0)
bl->props.power = FB_BLANK_POWERDOWN;
else
bl->props.power = FB_BLANK_UNBLANK;
Expand Down

0 comments on commit fe1328b

Please sign in to comment.