summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2017-04-05 08:49:00 +0200
committerDarren Hart (VMware) <dvhart@infradead.org>2017-04-13 10:16:05 -0700
commit07acf62a40f2410a00ed058db225c8f959ff8695 (patch)
tree68af4d8b76d8b44c39534bb9b24e92b7a6e2e7d2 /drivers/platform
parent09b29e1eda78d81218cf2304495c551d7714e0b0 (diff)
platform/x86: fujitsu-laptop: only handle backlight when appropriate
The backlight part of fujitsu-laptop is only used by laptops which are incapable of using the standard ACPI video interface for handling brightness changes. Conversely, on laptops which are capable of using the latter, no vendor-specific ACPI calls should be made unless explicitly requested by the user. Bail out immediately from acpi_fujitsu_bl_add() unless using the vendor-specific interface was either explicitly requested by the user or automatically selected by the kernel. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 928778ccc4c1..5e3e9511caaf 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -574,6 +574,9 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
int state = 0;
int error;
+ if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
+ return -ENODEV;
+
if (!device)
return -EINVAL;
@@ -626,11 +629,9 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
fujitsu_bl->max_brightness = FUJITSU_LCD_N_LEVELS;
get_lcd_level();
- if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
- error = fujitsu_backlight_register();
- if (error)
- return error;
- }
+ error = fujitsu_backlight_register();
+ if (error)
+ return error;
return 0;
}