提交 f951d6e6 编写于 作者: M Michał Kępień 提交者: Darren Hart

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: NMichał Kępień <kernel@kempniu.pl>
Reviewed-by: NPali Rohár <pali.rohar@gmail.com>
Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
上级 63c4029b
...@@ -874,15 +874,15 @@ static void dell_cleanup_rfkill(void) ...@@ -874,15 +874,15 @@ static void dell_cleanup_rfkill(void)
static int dell_send_intensity(struct backlight_device *bd) static int dell_send_intensity(struct backlight_device *bd)
{ {
struct calling_interface_buffer *buffer; struct calling_interface_buffer *buffer;
int token; struct calling_interface_token *token;
int ret; int ret;
token = find_token_location(BRIGHTNESS_TOKEN); token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
if (token == -1) if (!token)
return -ENODEV; return -ENODEV;
buffer = dell_smbios_get_buffer(); buffer = dell_smbios_get_buffer();
buffer->input[0] = token; buffer->input[0] = token->location;
buffer->input[1] = bd->props.brightness; buffer->input[1] = bd->props.brightness;
if (power_supply_is_system_supplied() > 0) if (power_supply_is_system_supplied() > 0)
...@@ -899,15 +899,15 @@ static int dell_send_intensity(struct backlight_device *bd) ...@@ -899,15 +899,15 @@ static int dell_send_intensity(struct backlight_device *bd)
static int dell_get_intensity(struct backlight_device *bd) static int dell_get_intensity(struct backlight_device *bd)
{ {
struct calling_interface_buffer *buffer; struct calling_interface_buffer *buffer;
int token; struct calling_interface_token *token;
int ret; int ret;
token = find_token_location(BRIGHTNESS_TOKEN); token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
if (token == -1) if (!token)
return -ENODEV; return -ENODEV;
buffer = dell_smbios_get_buffer(); buffer = dell_smbios_get_buffer();
buffer->input[0] = token; buffer->input[0] = token->location;
if (power_supply_is_system_supplied() > 0) if (power_supply_is_system_supplied() > 0)
dell_smbios_send_request(0, 2); dell_smbios_send_request(0, 2);
...@@ -1987,8 +1987,8 @@ static void kbd_led_exit(void) ...@@ -1987,8 +1987,8 @@ static void kbd_led_exit(void)
static int __init dell_init(void) static int __init dell_init(void)
{ {
struct calling_interface_buffer *buffer; struct calling_interface_buffer *buffer;
struct calling_interface_token *token;
int max_intensity = 0; int max_intensity = 0;
int token;
int ret; int ret;
if (!dmi_check_system(dell_device_table)) if (!dmi_check_system(dell_device_table))
...@@ -2030,10 +2030,10 @@ static int __init dell_init(void) ...@@ -2030,10 +2030,10 @@ static int __init dell_init(void)
if (acpi_video_get_backlight_type() != acpi_backlight_vendor) if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
return 0; return 0;
token = find_token_location(BRIGHTNESS_TOKEN); token = dell_smbios_find_token(BRIGHTNESS_TOKEN);
if (token != -1) { if (token) {
buffer = dell_smbios_get_buffer(); buffer = dell_smbios_get_buffer();
buffer->input[0] = token; buffer->input[0] = token->location;
dell_smbios_send_request(0, 2); dell_smbios_send_request(0, 2);
if (buffer->output[0] == 0) if (buffer->output[0] == 0)
max_intensity = buffer->output[3]; max_intensity = buffer->output[3];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册