Commit 5c461e8e authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart

platform/x86: fujitsu-laptop: simplify logolamp_get()

Now that call_fext_func() is invoked by logolamp_set() for both
LOGOLAMP_POWERON and LOGOLAMP_ALWAYS for every brightness value,
logolamp_get() can be simplified to decrease indentation and number of
local variables.
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Acked-by: default avatarJonathan Woithe <jwoithe@just42.net>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent dcb50b35
...@@ -319,17 +319,17 @@ static int eco_led_set(struct led_classdev *cdev, ...@@ -319,17 +319,17 @@ static int eco_led_set(struct led_classdev *cdev,
static enum led_brightness logolamp_get(struct led_classdev *cdev) static enum led_brightness logolamp_get(struct led_classdev *cdev)
{ {
enum led_brightness brightness = LED_OFF; int ret;
int poweron, always;
ret = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_ALWAYS, 0x0);
poweron = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_POWERON, 0x0); if (ret == FUNC_LED_ON)
if (poweron == FUNC_LED_ON) { return LED_FULL;
brightness = LED_HALF;
always = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_ALWAYS, 0x0); ret = call_fext_func(FUNC_LEDS, 0x2, LOGOLAMP_POWERON, 0x0);
if (always == FUNC_LED_ON) if (ret == FUNC_LED_ON)
brightness = LED_FULL; return LED_HALF;
}
return brightness; return LED_OFF;
} }
static enum led_brightness kblamps_get(struct led_classdev *cdev) static enum led_brightness kblamps_get(struct led_classdev *cdev)
......
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