aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYing Liu <[email protected]>2023-07-21 09:29:03 +0000
committerLee Jones <[email protected]>2023-07-28 12:00:11 +0100
commitfe1328b5b2a087221e31da77e617f4c2b70f3b7f (patch)
treef545b6dd43a62c8cf7baea3f2010b87e699af044
parent5145531be5fbad0e914d1dc1cbd392d7b756abaa (diff)
backlight: gpio_backlight: Drop output GPIO direction check for initial power state
So, let's drop output GPIO direction check and only check GPIO value to set the initial power state. Fixes: 706dc68102bc ("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]>
-rw-r--r--drivers/video/backlight/gpio_backlight.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c
index 6f78d928f054..38c46936fdcd 100644
--- a/drivers/video/backlight/gpio_backlight.c
+++ b/drivers/video/backlight/gpio_backlight.c
@@ -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;