aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2016-01-22 09:27:24 -0500
committerDarren Hart <dvhart@linux.intel.com>2016-03-23 13:05:42 -0400
commitf951d6e6faedcead91419b785f73a620d8ed191a (patch)
tree0693a69dd6edcec92d8c3c255a39f38c047d73c0 /drivers/platform
parent63c4029bdfc220ec3a1fa9135f5db3bdcd93b502 (diff)
dell-laptop: use dell_smbios_find_token() instead of find_token_location()
Replace all uses of find_token_location() with dell_smbios_find_token() to avoid directly accessing the da_tokens table. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/dell-laptop.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index 4d1694d972b1..76064c817f3d 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -874,15 +874,15 @@ static void dell_cleanup_rfkill(void)
874static int dell_send_intensity(struct backlight_device *bd) 874static int dell_send_intensity(struct backlight_device *bd)
875{ 875{
876 struct calling_interface_buffer *buffer; 876 struct calling_interface_buffer *buffer;
877 int token; 877 struct calling_interface_token *token;
878 int ret; 878 int ret;
879 879
880 token = find_token_location(BRIGHTNESS_TOKEN); 880 token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
881 if (token == -1) 881 if (!token)
882 return -ENODEV; 882 return -ENODEV;
883 883
884 buffer = dell_smbios_get_buffer(); 884 buffer = dell_smbios_get_buffer();
885 buffer->input[0] = token; 885 buffer->input[0] = token->location;
886 buffer->input[1] = bd->props.brightness; 886 buffer->input[1] = bd->props.brightness;
887 887
888 if (power_supply_is_system_supplied() > 0) 888 if (power_supply_is_system_supplied() > 0)
@@ -899,15 +899,15 @@ static int dell_send_intensity(struct backlight_device *bd)
899static int dell_get_intensity(struct backlight_device *bd) 899static int dell_get_intensity(struct backlight_device *bd)
900{ 900{
901 struct calling_interface_buffer *buffer; 901 struct calling_interface_buffer *buffer;
902 int token; 902 struct calling_interface_token *token;
903 int ret; 903 int ret;
904 904
905 token = find_token_location(BRIGHTNESS_TOKEN); 905 token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
906 if (token == -1) 906 if (!token)
907 return -ENODEV; 907 return -ENODEV;
908 908
909 buffer = dell_smbios_get_buffer(); 909 buffer = dell_smbios_get_buffer();
910 buffer->input[0] = token; 910 buffer->input[0] = token->location;
911 911
912 if (power_supply_is_system_supplied() > 0) 912 if (power_supply_is_system_supplied() > 0)
913 dell_smbios_send_request(0, 2); 913 dell_smbios_send_request(0, 2);
@@ -1987,8 +1987,8 @@ static void kbd_led_exit(void)
1987static int __init dell_init(void) 1987static int __init dell_init(void)
1988{ 1988{
1989 struct calling_interface_buffer *buffer; 1989 struct calling_interface_buffer *buffer;
1990 struct calling_interface_token *token;
1990 int max_intensity = 0; 1991 int max_intensity = 0;
1991 int token;
1992 int ret; 1992 int ret;
1993 1993
1994 if (!dmi_check_system(dell_device_table)) 1994 if (!dmi_check_system(dell_device_table))
@@ -2030,10 +2030,10 @@ static int __init dell_init(void)
2030 if (acpi_video_get_backlight_type() != acpi_backlight_vendor) 2030 if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
2031 return 0; 2031 return 0;
2032 2032
2033 token = find_token_location(BRIGHTNESS_TOKEN); 2033 token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
2034 if (token != -1) { 2034 if (token) {
2035 buffer = dell_smbios_get_buffer(); 2035 buffer = dell_smbios_get_buffer();
2036 buffer->input[0] = token; 2036 buffer->input[0] = token->location;
2037 dell_smbios_send_request(0, 2); 2037 dell_smbios_send_request(0, 2);
2038 if (buffer->output[0] == 0) 2038 if (buffer->output[0] == 0)
2039 max_intensity = buffer->output[3]; 2039 max_intensity = buffer->output[3];